Internal EmailId API Retrieval

Hi,

Trying to created Dynamic Lists filtered by some Email action I realized it is expected to use the Internal HubSpot IDs, not the regular Email ID:

I’ve been trying some property names in this query: https://api.hubapi.com/marketing/v3/emails/186899289459?includedProperties=
but I can’t find the correct one to retrieve the Internal ID, is it possible to get that value through API?
Thanks.


@AlejandroGarcia wrote:

Hi,

Trying to created Dynamic Lists filtered by some Email action I realized it is expected to use the Internal HubSpot IDs, not the regular Email ID:

I’ve been trying some property names in this query: https://api.hubapi.com/marketing/v3/emails/186899289459?includedProperties=
but I can’t find the correct one to retrieve the Internal ID, is it possible to get that value through API?
Thanks.


You can use the Get all marketing emails endpoint. This endpoint provides a list of marketing emails, each with its internal ID. To make a request, send a GET request to:

https://api.hubapi.com/marketing-emails/v1/emails?hapikey=YOUR_HUBSPOT_API_KEY

Replace YOUR_HUBSPOT_API_KEY with your actual HubSpot API key. The response will include details of each email, such as its ID, name, and subject. The ID field in the response represents the internal HubSpot ID for the email. For example:
{
“id”: 123456,
“name”: “Email Name”,
“subject”: “Email Subject”
}

If you need to filter emails based on their internal ID, this method will allow you to retrieve the correct value. For more details, you can refer to HubSpot’s Marketing Emails API v1 documentation here Marketing API | Marketing Email - HubSpot docs.

Unfortunately, this is only a temporary solution.

The v1 api (/marketing-emails/v1/emails) will stop working in October.

“To avoid disruption, please migrate to the new v3 Email API before October 1, 2025. If you don’t complete the update by this date, any requests to the v1 Marketing Email API will result in an error.

This is a breaking change for us - we are tracking certain emails and need to know who actually received it - a call to /email/public/v1/events for the specific email where the only way to get these results is to supply the internal Hubspot ID as the campaignId

parameter.

I can’t just pull all of the email events, because in the returned results the email is also identified with the campaignId, not the Marketing email ID.

Thanks Hmir for solution