Need Help: Accessing Email Open Count for Last 30 Days via API
What I’m Trying to Do: Build a custom workflow action that returns the exact number of email opens for a contact in the last 30 days. This data will populate a custom CRM card that shows sales reps how an MQL achieved their lead score. The sales team doesn’t look through activity timelines or general reports - they need this information displayed concisely in the contact record. I plan to expand this to other lead scoring properties like page views in last 30 days.
The Problem: I can see individual email opens with dates in the HubSpot UI (contact timeline), but cannot access this granular data through the APIs.
What I’ve Tried:
- CRM Contacts API - Only returns marketing_emails_opened (lifetime total) and hs_email_last_open_date (single date)
- Marketing Email Events API - Returns 400 errors: “Unable to infer object type from: email_events”
- Communications Object - Returns 0 results despite having email data
- Reporting API - 404 errors when trying to access email metrics
Current Setup:
- Private app with crm.objects.contacts.read/write scopes
- Standard Marketing Hub account
- Node.js with @hubspot/api-client
What I Have vs What I Need:
- Available: hs_email_last_open_date: “2025-05-04T17:05:55.893Z”
- Need: Count of opens within 30 days from today
Questions:
- Is there an API endpoint for granular email event data (individual opens with timestamps)?
- Do I need different scopes or a higher-tier HubSpot plan?
- Is the Timeline Events API the right approach? Where’s the documentation?
- Any alternative approaches to get email engagement data programmatically?
The data exists in HubSpot’s UI but seems inaccessible via standard APIs. Any guidance on the correct approach would be appreciated.