POST/api/v1/templates

Create a template

Creates a template in the project. Supply type and name in data, and provide a body field that matches the template type: mjml_body, html_body, or text_body. For hybrid templates, omit body fields; mjml, html, and text templates can use content slots.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 body field

Template creation attributes, supplied in a data object.

dataobjectoptional
The template attributes, including required `type` and `name` values.

1 status code
200Returns the created template object, including its identifier, name, type, body content, content slots, styles, assigns, and timestamps.
dataobjectoptional

Error handling

type and name are required within data, and type must be text, html, mjml, or hybrid. The data object accepts only the fields defined for template creation.