Templates API
Templates define the visual layout and content of the emails sent by chains. All endpoints require authentication.
Template object
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier (read-only) |
title | String | Template name |
template_subject | String | Email subject line (supports template variables) |
theme_id | Int | Parent theme ID — see Themes |
description | String | Optional description |
template_text | String | Rendered full HTML of the template (read-only, computed) |
theme | Object | Nested theme object (read-only) |
areas | String[] | List of content area names defined by the theme (read-only) |
template_areas | String[] | Content of each area as a flat array without keys (read-only; key order matches areas) |
template_areas_serialized | String | JSON-encoded map of area name → content (use this for write operations) |
system | Boolean | Whether this is a built-in system template (read-only) |
created_at | String | Creation timestamp (read-only) |
updated_at | String | Last 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.