Access and test APIs in beta. 

Please note: This API is currently in beta and is subject to change based on testing and feedback. By using these endpoints you agree to adhere to our Developer TermsDeveloper BetaTerms. You also acknowledge and understand the risk associated with testing an unstable API. 


Marketing Email (BETA)

The Marketing Emails API can be used to programmatically create, update, and get details about marketing emails. You can also query details about the post-send statistics of a specific email or set of emails. These statistics should match what you can access in the app on the Details section of a particular email and will be returned under the stats object in your JSON response.
 
The Marketing Email API cannot be used to create or retrieve data for sales emails that are created and sent via the contact record. To get details for sales emails, use the Engagements API.

Please note:

  • To programmatically send transactional emails to contacts, use the Single-send API.
  • To use the /publish and /unpublish endpoints, you must have a Marketing Hub Enterprise account or the transactional email add-on.

Create a marketing email

To create an email, make a POST request to /marketing/v3/emails and include the following fields in the body of your request:

// Example request body for POST request to /marketing/v3/emails { "name": "A new marketing email", "subject": "Behold the latest version of our newsletter!", "templatePath": "@hubspot/email/dnd/welcome.html" }
Please note: if you purchased the business units add-on, you must include the businessUnitId field in the request body. You can get a list of business units in your account using the business units API.

Retrieve a marketing email

You can retrieve existing emails in your account individually or in batches:

  • To retrieve an individual email, make a GET request to /marketing/v3/emails/{emailId}
  • To retrieve a list of all emails, make a GET request to /marketing/v3/emails, and include any filters as query parameters in your request (e.g., add createdAfter and a date in ISO8601 format to get all emails created after a specific date).

Click the Endpoints tab at the top of this article for a full list of endpoints and the associated parameters available.


Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.