Themes API
Themes define the outer HTML wrapper (header, footer, styles) that templates are rendered within. All endpoints require authentication.
Theme object
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier (read-only) |
title | String | Theme name |
description | String | Optional description |
template_text | String | Theme HTML/Liquid/PHP source code |
template_type | Int | Magento template type: 1 = Text, 2 = HTML; 0 if unset |
List themes
GET /rest/V1/mst-email/themes
Supports filtering and pagination.
Get theme
GET /rest/V1/mst-email/themes/:id
Response:
{
"id": 1,
"title": "Default Theme",
"description": "",
"template_text": "<!DOCTYPE html>...",
"template_type": 2
}
Errors: 404 theme not found.
Create theme
POST /rest/V1/mst-email/themes
Request body:
{
"theme": {
"title": "Custom Theme",
"description": "",
"template_text": "<!DOCTYPE html><html>...</html>",
"template_type": 2
}
}
Response: the created theme object with id assigned.
Update theme
PUT /rest/V1/mst-email/themes/: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 theme.
Response: the updated theme object.
Errors: 404 theme not found.
Delete theme
DELETE /rest/V1/mst-email/themes/:id
Response:
true
Errors: 404 theme not found.