# Marketing emails api endpoint

**URL:** <https://community.hubspot.com/t/marketing-emails-api-endpoint/133176>\
**Category:** APIs & Integrations\
**Tags:** python, email\
**Created:** [May 21, 2025, 9:02pm UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176 "2025-05-21T21:02:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LF\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@LF\_Ruiz](https://community.hubspot.com/u/LF_Ruiz)\
**Post date:** [May 21, 2025, 9:02pm UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176/1 "2025-05-21T21:02:37Z")

</div>

Hello,

We are working with python and HubSpot API, using both the hubspot api library for python and the requests library depending on the endpoint we are using.

We have found a roadblock trying to retrieve the marketing emails and tie them to a contact and get the exact action that contact took with the email (either open, click, bounce, etc).Does anyone know if this is possible and if it is, how can make the call/calls?

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [May 22, 2025, 10:02am UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176/2 "2025-05-22T10:02:33Z")

</div>

Hi [@LF\_Ruiz](https://community.hubspot.com/t5/user/viewprofilepage/user-id/943128) and welcome, we are so glad to see you here! 🤗  
Great question, thanks for asking the HubSpot Community!  
For information, here is the “[Marketing Email API](https://developers.hubspot.com/docs/guides/api/marketing/emails/marketing-emails)” documentation.  
I found for you the solution from @Bortami on this post “[Get marketing e-mails per Contact](https://community.hubspot.com/t5/APIs-Integrations/Get-marketing-e-mails-per-Contact/m-p/1059527)” that might be of interest.  
I’d love to put you in touch with our Top Experts: Hi @Bortami, [@sylvain\_tirreau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366) and [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) do you have suggestions to help [@LF\_Ruiz](https://community.hubspot.com/t5/user/viewprofilepage/user-id/943128), please?  
Have a great day and thanks so much in advance for your help! ❤  
Bérangère

---

<div class="post-metadata">

**Author:** ![sylvain\_tirreau](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sylvain_tirreau/32/67408_2.png) [@sylvain\_tirreau](https://community.hubspot.com/u/sylvain_tirreau)\
**Post date:** [May 22, 2025, 10:30am UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176/3 "2025-05-22T10:30:08Z")

</div>

Hello,

You should start there and see if you find a starting point to create your code (list the events and look for clicks and email opens, then use the Email Marketing API and Contacts API to refine the data you need):

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fevents-events-v3%2Fevents%2Fget-events-v3-events-)**

---

<div class="post-metadata">

**Author:** ![Balaji\_Mavlers1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/balaji_mavlers1/32/59061_2.png) [@Balaji\_Mavlers1](https://community.hubspot.com/u/Balaji_Mavlers1)\
**Post date:** [May 22, 2025, 10:58am UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176/4 "2025-05-22T10:58:33Z")

</div>

Hi [@LF\_Ruiz](https://community.hubspot.com/t5/user/viewprofilepage/user-id/943128)  
Yes, this is possible using HubSpot APIs. You’ll need to combine two APIs to achieve this:  
Step 1

Use the **Email Events API** (Legacy) to find out what actions a contact took on marketing emails (e.g., opened, clicked, bounced).

You’ll need the contact’s email address.

```lia-code-sample
import requests

TOKEN = 'your_private_app_token'
headers = {
 'Authorization': f'Bearer {TOKEN}',
 'Content-Type': 'application/json'
}

params = {
 'recipient': 'contact@example.com',
 'limit': 100
}

response = requests.get(
 'https://api.hubapi.com/email/public/v1/events',
 headers=headers,
 params=params
)

for event in response.json().get('events', []):
 print(event['type'], event['emailCampaignId'], event['timestamp'])

```

This will return event types like:

- Open
- Click
- Bounce
- Unsubscribe  
Step 2

Once you have the emailCampaign id from the events, use the **Marketing Emails API v3** to get info about the email (like subject line and send time):

```lia-code-sample
email_id = '123456' # use emailCampaignId from above
response = requests.get(
 f'https://api.hubapi.com/marketing/v3/emails/{email_id}',
 headers=headers
)

email_data = response.json()
print(email_data['subject'], email_data['publishDate'])

```

Hope this helps…

---

<div class="post-metadata">

**Author:** ![LF\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@LF\_Ruiz](https://community.hubspot.com/u/LF_Ruiz)\
**Post date:** [June 9, 2025, 8:30pm UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176/5 "2025-06-09T20:30:10Z")

</div>

Hi [@sylvain\_tirreau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366) and [@Balaji\_Mavlers1](https://community.hubspot.com/t5/user/viewprofilepage/user-id/754021)! Thanks for your answer! I’m testing it and I have one question that maybe you can solved, How should I write the request to get me all the events related to an specific campaign?  
I already have the campaign ids, base on a list of campaigns ids (using a for loop for example) I would like to get all the events related to it.

The goal with this is not to query all the events everyday, but just to get the campaigns I’m interested in.

---

<div class="post-metadata">

**Author:** ![sylvain\_tirreau](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sylvain_tirreau/32/67408_2.png) [@sylvain\_tirreau](https://community.hubspot.com/u/sylvain_tirreau)\
**Post date:** [June 11, 2025, 3:06pm UTC](https://community.hubspot.com/t/marketing-emails-api-endpoint/133176/6 "2025-06-11T15:06:17Z")

</div>

Hi [@LF\_Ruiz](https://community.hubspot.com/t5/user/viewprofilepage/user-id/943128) ,

You can try something like that:

[https://api.hubapi.com/events/v3/events?objectType=CAMPAIGN&objectId=12345&limit=100](https://api.hubapi.com/events/v3/events?objectType=CAMPAIGN&objectId=12345&limit=100)

The response contains a paging.offset field to paginate; return it in your next call via &offset={offset}
