Association between email activity and email events



I want to link an email (so an activity that has the type email) to email events but when I retrieve all email events, I can't see how I can know which email each event is associated to.

Is there a unique id enabling me to identify one email event as associated with a specific email?

Thank you


Hi, @joparisot.

To clarify, are you using this endpoint and trying to determine which SENT, DELIVERED, OPEN, etc. events are associated with certain HubSpot marketing emails?

If so, you can use the emailCampaignId value for each event. Every campaignId reflects a specific send of a marketing email. You can cross-reference the IDs with the values from the Get all campaign IDs and Get campaign data for a given campaign endpoints.

Engagements with the type EMAIL, on the other hand, are not marketing emails. Opens and clicks for these emails cannot be retrieved with an API. This topic goes into a bit more detail.