Skip to main content
POST
Create a template from raw HTML, or from an MJML definition. Send exactly one of html and mjml. A template created from an MJML definition is editable in the Ecomail drag-and-drop editor. Ecomail compiles the definition to HTML for you, so the template is ready to send right away. A template created from raw HTML is editable only in the code editor.
string
required
Template name.
string
Template HTML content. Required when mjml is not sent. Do not combine with mjml.
object
MJML definition of the template, in the same JSON format the Ecomail editor uses. Required when html is not sent.The definition is a tree of nodes. Each node has a tagName (an MJML component such as mj-section, mj-column, mj-text, mj-image, or mj-button), optional attributes, and either children or content. The root node must contain a children array.