I'm getting conflicting information from both HS docs and AI as I try and find this answer.
Can I use drag and drop templates as templates that create emails via the API? We have a lot of templates in there, and I would like to more programmatically create emails, however when I used the templateid long with individual modules within that template, nothing matched up. An email was created, but no content filled any modules and it did not inherit the modules of the drag and drop template.
Hey @boostmyemail , always refer to the official HS docs, the templateid you are referring must be an AI slop. The Marketing Email and Single Send APIs don't accept template IDs. You basically construct the entire email content structure in the request body as JSON based on the format in the API docs.
Also, you can create an email through the HubSpot UI and then pull it via the GET /marketing/v3/emails/{email-id} endpoint. This will provide the JSON that you can refer to and use to create the marketing emails via the POST /marketing/v3/emails/ endpoint.
✔️ Did this post help answer your query? Help the community by marking it as a solution.
Hi @boostmyemail , thanks for raising this, the docs and AI can definitely send mixed signals here.
The short answer is no, you cannot pass a drag and drop templateId and expect the Marketing Email or Single Send APIs to “apply” that template automatically. Those endpoints ignore template IDs and expect you to send the full email structure as JSON in the request body, including all modules and their contents (https://developers.hubspot.com/docs/api-reference/marketing-marketing-emails-v3/guide )
That is why your email was created but did not inherit modules or content from the drag and drop template.
The safest pattern is to treat your drag and drop templates as authoring tools, not API primitives. Build one email in the UI using the drag and drop template you like, publish or save it, then fetch it via GET /marketing/v3/emails/{emailId}.
The JSON you get back is your “real” template for the API: you can inspect the modules, copy that structure, and then create new emails by POST /marketing/v3/emails with the same layout and only swapping texts, images, or personalization tokens. It is a bit more verbose at first, but once you have that base payload, it becomes very straightforward to generate emails programmatically.
If the bigger goal here is to send highly personalized emails based on data that lives in another system, Stacksync keeps HubSpot and your source database in two-way sync so the right fields and statuses are always there when your API-created emails go out.
Did my answer help? Please mark it as a solution to help others find it too.
Ruben Burdin HubSpot Advisor Founder @ Stacksync Real-Time Data Sync between any CRM and Database
Hi @boostmyemail , thanks for raising this, the docs and AI can definitely send mixed signals here.
The short answer is no, you cannot pass a drag and drop templateId and expect the Marketing Email or Single Send APIs to “apply” that template automatically. Those endpoints ignore template IDs and expect you to send the full email structure as JSON in the request body, including all modules and their contents (https://developers.hubspot.com/docs/api-reference/marketing-marketing-emails-v3/guide )
That is why your email was created but did not inherit modules or content from the drag and drop template.
The safest pattern is to treat your drag and drop templates as authoring tools, not API primitives. Build one email in the UI using the drag and drop template you like, publish or save it, then fetch it via GET /marketing/v3/emails/{emailId}.
The JSON you get back is your “real” template for the API: you can inspect the modules, copy that structure, and then create new emails by POST /marketing/v3/emails with the same layout and only swapping texts, images, or personalization tokens. It is a bit more verbose at first, but once you have that base payload, it becomes very straightforward to generate emails programmatically.
If the bigger goal here is to send highly personalized emails based on data that lives in another system, Stacksync keeps HubSpot and your source database in two-way sync so the right fields and statuses are always there when your API-created emails go out.
Did my answer help? Please mark it as a solution to help others find it too.
Ruben Burdin HubSpot Advisor Founder @ Stacksync Real-Time Data Sync between any CRM and Database
Also, you can create an email through the HubSpot UI and then pull it via the GET /marketing/v3/emails/{email-id} endpoint. This will provide the JSON that you can refer to and use to create the marketing emails via the POST /marketing/v3/emails/ endpoint.
✔️ Did this post help answer your query? Help the community by marking it as a solution.
Hey @boostmyemail , always refer to the official HS docs, the templateid you are referring must be an AI slop. The Marketing Email and Single Send APIs don't accept template IDs. You basically construct the entire email content structure in the request body as JSON based on the format in the API docs.