Skip to main content

Templates API

Templates define the visual layout and content of the emails sent by chains. All endpoints require authentication.

Template object

FieldTypeDescription
idIntUnique identifier (read-only)
titleStringTemplate name
template_subjectStringEmail subject line (supports template variables)
theme_idIntParent theme ID — see Themes
descriptionStringOptional description
template_textStringRendered full HTML of the template (read-only, computed)
themeObjectNested theme object (read-only)
areasString[]List of content area names defined by the theme (read-only)
template_areasString[]Content of each area as a flat array without keys (read-only; key order matches areas)
template_areas_serializedStringJSON-encoded map of area name → content (use this for write operations)
systemBooleanWhether this is a built-in system template (read-only)
created_atStringCreation timestamp (read-only)
updated_atStringLast update timestamp (read-only)

template_areas_serialized holds the serialized content blocks that define what appears in each area of the theme. The structure depends on the theme layout. When referencing a template from a chain, use the format emaildesigner:{template_id}.

List templates

GET /rest/V1/mst-email/templates

Supports filtering and pagination.

Get template

GET /rest/V1/mst-email/templates/:id

Response:

{
"id": 3,
"title": "Abandoned Cart - Day 1",
"template_subject": "You left something behind, {{customer.firstname}}!",
"theme_id": 1,
"description": "",
"template_areas_serialized": "{\"preview\":\"\",\"header\":\"...\",\"content\":\"...\",\"footer\":\"...\"}",
"created_at": "2026-02-01 10:00:00",
"updated_at": "2026-05-10 14:00:00"
}

Errors: 404 template not found.

Create template

POST /rest/V1/mst-email/templates

Request body:

{
"template": {
"title": "New Template",
"template_subject": "Hello, {{customer.firstname}}",
"theme_id": 1,
"description": "",
"template_areas_serialized": "[]"
}
}

Response: the created template object with id assigned.

Update template

PUT /rest/V1/mst-email/templates/:id

PUT is a partial update — send only the fields you want to change; omitted fields retain their current values.

Request body: same structure as Create template.

Response: the updated template object.

Errors: 404 template not found.

Delete template

DELETE /rest/V1/mst-email/templates/:id

Response:

true

Errors: 404 template not found.