How we are using the HubSpot API
We’re using the HubSpot API to get click/open/send events on marketing emails sent since a given timestamp.
We use
email/public/v1/campaigns to get a list of email campaign IDs with activity since a given timestamp.
Then for each campaign ID:
1. Get the campaign data from
email/public/v1/campaigns/{id}
2. Use contentId from the response to get email data from
marketing-emails/v1/emails/{contentId}
3. Get click/open/send events from
email/public/v1/events?campaignId={campaignId}&eventType={click|open|processed}
What does the v1 suset mean for us?
My main question is in the title of this post - are all v1 APIs being sunset after 30th September 2025?
The post Marketing Email API: v3 released to general availability and upcoming sunset for v1 includes the line:
“Any requests to the v1 API after this date will result in an error.”
But does this only apply to endpoints starting with /marketing-emails/v1/, or does it apply to all HubSpot API endpoints containing /v1/?
How would we use the v3 API to achieve what we’re doing?
Getting campaigns that have activity after a given timestamp
Looking through the API docs, I can’t see a way of using the v3 API to get all campaigns that have activity after a given timestamp. I think the best we can do is to use
marketing/v3/emails/statistics/list to get IDs for emails that have activity after a given timestamp, then use
marketing/v3/emails/{id} to get the list of campaigns for the email via the
allEmailCampaignIds property.
This is not ideal since it will include campaigns that have not had actitivy since the timestamp and I don’t see a way of verifying which campaigns have actually had activity.
Is there a neater way to get IDs for all campaigns that have changed since a timestamp?
Getting campaign details
The v3 equivalent of email/public/v1/campaigns/{id} seems to be marketing/v3/campaigns/{campaignGuid} but this expects a guid rather than a numeric ID.
How do I obtain that guid?
Getting email events
There doesn’t seem to be a v3 equivalent of
email/public/v1/events
How do I use a campaign ID in the v3 API to get the associated click/open/send events?