Create an email template
Create a reusable email template (a design saved to the Templates list, not sent by itself). Use it when the user asks for a template or a design to reuse; to send an email to contacts, create a campaign with Create Email Campaign (optionally from this template with templateId).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your access token.
emails/ templates. writeOAuthPrivate IntegrationSub-Account TokenRequest
Headers
Unique key per intended write (max 255 chars). Retrying with the same key and body within 24 hours returns the first response instead of creating another resource. Reusing the key with a different body returns 422; a retry while the first request is still running returns 409.
0f8fad5b-d9cb-469f-a165-70867728950eAPI Version
v3v3Path Parameters
Location ID
ve9EPM428h8vShlRW1KTBody
Template name
Newsletter TemplateEditor type for the new template. html = code editor (raw HTML string), text = plain-text email (string), builder = design (drag-and-drop) editor (JSON, see BuilderEditorContentPublicV2Dto). Merge fields are Handlebars: {{contact.first_name}}, a fallback is {{default contact.first_name "there"}}, a condition is {{#if contact.city}}...{{/if}}. Liquid filters such as {{contact.first_name | default: "there"}} are not supported and block the send. Send editorType alone to create a blank template.
htmlbuildertexthtmlOptional initial editor content: an HTML or plain-text string for html/text, or design-editor JSON for builder. Design-editor (builder) JSON. elements is the layout tree: mj-section > mj-column > leaf elements. Every node has a unique id and a tagName. attrs is a flat map keyed by node id (one entry for every node in the tree, sections and columns included): { tagName, content, attributes: [{ name, default, unit? }] }. content holds the text/HTML of leaf elements such as mj-text and mj-button. Each attribute is { name, default, unit? }: default is the value, and sizes are a number plus unit (px or %), e.g. { name: "font-size", default: 16, unit: "px" }. Padding is split into padding-top, padding-right, padding-bottom and padding-left with enable-padding set to true; the padding shorthand and inline style are not read by the editor. Send the full attribute set below for every element, changing only the values you need. When an element is selected in the editor, every listed attribute missing from the JSON is written in with the default shown here, so a partial list changes the design (background, padding, font) on first click. Text and image backgrounds use container-background-color; section and button backgrounds use background-color. Element attributes and the editor defaults: mj-section: enable-padding=true, padding-top=10px, padding-right=20px, padding-bottom=10px, padding-left=20px, background-color=#ffffff, background-url="", background-size=auto, background-repeat=repeat, full-width=false, text-align=center, border-radius=0px, border-width=0px, border-color="". mj-column: enable-padding=true, padding-top=0px, padding-right=0px, padding-bottom=0px, padding-left=0px, is-unstacked=false. mj-text: enable-padding=true, padding-top=12px, padding-right=24px, padding-bottom=12px, padding-left=24px, font-family=arial, helvetica, sans-serif, font-size=14px, line-height=1.5, container-background-color="". mj-image: enable-padding=true, padding-top=10px, padding-right=20px, padding-bottom=10px, padding-left=20px, src=https://..., alt="", href="", width=null, height=null, align=center, border-radius=0px, container-background-color="". mj-button: enable-padding=true, padding-top=10px, padding-right=20px, padding-bottom=10px, padding-left=20px, background-color=#00a4bd, color=#ffffff, font-family=Ubuntu, Helvetica, Arial, sans-serif, font-size=14px, align=center, border-radius=6px, border-width=0px, border-color=#00a4bd, redirectAction=url, url="". mj-divider: enable-padding=true, padding-top=10px, padding-right=20px, padding-bottom=10px, padding-left=20px, border-width=2px, border-color=#99acc2, border-style=solid, width=100%, align=center. mj-spacer: height=20px, container-background-color="". Buttons are mj-button elements (text in content, colors and link in attributes). mj-text content is edited as rich text and keeps only paragraphs, headings <h1>-<h6>, text-align, <span style> font/size/color, <strong>, <em>, <u>, <s>, links <a href>, lists and <br>; other markup (a link styled as a button with background or padding, tables, <div>, block styles) renders in the email but the editor drops it on edit, so the canvas shows something different from what is sent. Images: mj-image needs src set to a public https URL of the image (upload a file first with the Medias API and use its URL); without src the editor shows a placeholder. Set alt for accessibility and href to make the image a link. Leave width and height as null for the natural size (capped to the column) or set a number with unit: "px"; never omit them or send "". templateSettings holds template-wide theme settings as lists of { name, default, unit? } grouped by body (width, background-color, body-color, border, background image), button, divider, text (fonts, line-height, link styles) and header (customCss). To keep the current theme, send back the templateSettings that Get returned. Text fonts: inside mj-text content set font-family, font-size and color on a <span style="..."> around the text (e.g. <h1><span style="font-family: georgia, palatino, serif; font-size: 32px">Title</span></h1>); the editor toolbar reads fonts only from these spans, so styles on <h1>/<p> themselves show as the default font and size. Use one of these exact font-family values: arial, helvetica, sans-serif, helvetica, arial, sans-serif, verdana, geneva, sans-serif, georgia, palatino, serif, 'times new roman', times, serif, 'trebuchet ms', geneva, sans-serif, 'arial black', sans-serif, 'andale mono', monospace, Ubuntu, Helvetica, Arial, sans-serif. Google fonts: use 'Font Name', <fallback from the list above> (quotes only when the name has a space) and list every Google font used in templateSettings.text as { name: "custom-fonts", default: "Font One;Font Two" }; fonts not listed there are not loaded and fall back. Brand-board fonts: use 'Brand Font Name', <fallback> and list their brand font ids in { name: "brand-custom-fonts", default: "id1;id2" }. Keep both entries when sending back templateSettings. Supported leaf tags: mj-text, mj-image, mj-logo, mj-button, mj-divider, mj-spacer, mj-social, mj-video, mj-raw, mj-footer, mj-accordion, mj-carousel, mj-countdown-timer, mj-form, mj-product, mj-shopping-cart, mj-review-link, mj-rss-header, mj-rss-item, mj-preview-url. For tags not listed above, copy an existing element of that tag from a Get response. Buttons link through redirectAction (url, mail, telephone, sms, skype, other, file) plus the attribute it names, e.g. { name: "redirectAction", default: "url" } with { name: "url", default: "https://..." }; href alone renders no link. Nodes without an attrs entry are skipped when rendering. Merge fields are Handlebars: {{contact.first_name}}, a fallback is {{default contact.first_name "there"}}, a condition is {{#if contact.city}}...{{/if}}. Liquid filters such as {{contact.first_name | default: "there"}} are not supported and block the send.
<html><body>Hello World</body></html>Parent folder ID
67f15c2ae99226d5bcccb8f0Email subject line
Welcome to our newsletterSender name
John DoePreview text
Email preview textID of the user performing this action
507f1f77bcf86cd799439011Response
Success
Template ID
507f1f77bcf86cd799439011Template name
Newsletter TemplateEditor type. html = code editor (raw HTML string), text = plain-text email (string), builder = design (drag-and-drop) editor (JSON, see BuilderEditorContentPublicV2Dto). Merge fields are Handlebars: {{contact.first_name}}, a fallback is {{default contact.first_name "there"}}, a condition is {{#if contact.city}}...{{/if}}. Liquid filters such as {{contact.first_name | default: "there"}} are not supported and block the send.
htmlbuildertexthtmlWhether template is plain text
falseParent folder ID
67f15c2ae99226d5bcccb8f0Sender name
John DoeEmail subject line
Welcome to our newsletterPreview text
Email preview textPreview URL
https://example.com/preview/template123Created timestamp
2025-07-24T11:55:43.598ZUpdated timestamp
2025-07-24T11:55:43.598ZTrace ID of request
019e4ef5-a65e-4198-8cf9-8e93dca9bda4