Appearance
Templates
Full reference for the Templates resource in the bluefox.email API. See the API overview for authentication, the response envelope, and pagination.
List templates
GET /v1/projectId/{projectId}/templates
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
projectId | path | string | yes | The project _id, found in the app under Project Settings. |
limit | query | integer | Max items per page. Capped at 30. | |
skip | query | integer | Number of items to skip, for pagination. | |
sort | query | string | Field to sort by. | |
order | query | string | ||
filter[<field>] | query | string | Exact-match filter on a top-level field, e.g. filter[name]=Welcome. Repeatable for multiple fields. |
Responses
| Status | Description |
|---|---|
| 200 | OK |
| 403 | Missing or invalid API key |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
items | array | ||
count | integer | Total matching items across all pages, not just this page. | |
next | string | Full URL (path + query string) of the next page, or null if this is the last page. |
Create a template
POST /v1/projectId/{projectId}/templates
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
projectId | path | string | yes | The project _id, found in the app under Project Settings. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
subject | string | yes | |
previewText | string | On PATCH, pass an empty string to clear it. | |
document | any | yes | The template content. A Chamaileon visual-editor JSON document (type "chamaileon"): an object with a top-level "body". To change an existing design, GET the email/template, edit its document and send it back. To write one: {"body":{"type":"body","style":{"backgroundColor":"#f4f4f4"},"children":[fullwidth elements]}}. - A fullwidth element is {"type":"fullwidth","style":{"contentBackgroundColor":"#ffffff","contentPaddingTop":"20px",...},"children":[elements]} (600px wide). - Elements inside it: {"type":"text","attrs":{"text":"<h1>..</h1><p>..</p>"},"style":{"paragraphFontFamily":"Verdana, Geneva, sans-serif","paragraphColor":"#333333","paragraphFontSize":"16px","linkColor":"#0094c5","h1FontFamily":"Georgia, serif","h1Color":"#111111"}} (also h2/h3 FontFamily, Color, FontSize - set link colors here, an inline color on <a> is overridden), {"type":"button","attrs":{"text":"<p>Shop</p>","href":"https://.."},"style":{"backgroundColor":"#0094c5"}}, {"type":"image","attrs":{"src":"https://..","altText":"..","link":""},"style":{"width":"560px","maxWidth":"560px"}}, {"type":"divider"}, {"type":"social","attrs":{"elements":[{"type":"Facebook","link":"https://..","src":"img/Facebook/fb-3-colorful.png"}],"color":"colorful","iconSet":3}} (src is img/<network>/<prefix>-<iconSet>-<color>.png; iconSet 1-5; color colorful, black, grey or white; networks and prefixes: Blogger BL, Facebook fb, Instagram ig, Linkedin li, Medium ME, Pinterest PT, Snapchat SN, SoundCloud SC, Spotify SP, Telegram TG, TikTok tt, Tumblr TU, Twitter tw, Vimeo VI, Vkontakte VK, WeChat WC, YouTube YT), {"type":"box","style":{"backgroundColor":"..","paddingTop":"16px","borderRadius":"8px"},"children":[elements]}, columns {"type":"multicolumn","children":[{"type":"column","style":{"width":"280px"},"children":[elements]}, ...]} (widths add up to the space available), {"type":"typed-text","attrs":{"text":"Plain text"},"style":{"subType":"heading1","fontSize":"32px","color":"#111111","fontFamily":"Georgia, serif","align":"center","bold":true}} (subType paragraph, heading1-3 or list; takes plain text and its own style, while text takes HTML), {"type":"code","attrs":{"title":"Custom HTML","content":"<div style="font-size:16px">..</div>"}} (raw HTML, it must set its own font-size), {"type":"dynamic-image","attrs":{"src":"{{this.image.url}}","altText":".."},"style":{"width":"150px","height":"150px"}} (image URL from a merge tag), {"type":"video","attrs":{"videoId":"..","videoProvider":"youtube","link":"https://..","previewBaseUrl":"https://video.chamaileon.io/thumbnail/original/","thumbnailBaseUrl":"https://video.chamaileon.io/thumbnail/generated/"}} (thumbnail generated from the videoId; not in the app editor's toolbox). - Personalization: {"type":"loop","attrs":{"expression":"news.item limit=5 skip=0"},"children":[elements]} repeats its children per feed item (use {{this.title}} inside; add the feed in the feeds field), and {"type":"conditional","children":[{"type":"branch","attrs":{"type":"if","expression":"(EQ contact.plan "pro")"},"children":[elements]},{"type":"branch","attrs":{"type":"else"},"children":[elements]}]} (branch type if, else-if or else). block-level-loop and block-level-conditional work the same but sit directly in body and wrap whole fullwidth elements. - To give conditional branches different backgrounds, put a box with the background in each branch: the generator can apply the first branch's fullwidth colors to all branches. - Nesting: body holds only fullwidth and block-level-*; fullwidth, box, column, loop and branch hold elements; multicolumn holds only column; conditional holds only branch. - Colors, fonts and images can use a design system variable, e.g. "color":{"reference":"name","default":"#111111"} (see GET /v1/projectId/{projectId}/design-systems). - Every element needs a unique "eid" and style values are CSS strings with px units. The MCP server fills in any missing eid and the editor's default style/attrs keys for you; this API stores the document exactly as sent, so send complete elements (e.g. copy them from an existing document). - Merge tags like {{contact.name}} and {{unsubscribeLink}} work in text and links. Quote strings in them with single quotes, e.g. {{DEFAULT contact.url 'https://..'}}: double quotes break the generated src and href attributes. |
tags | array of string | ||
onProjectCreation | string (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign) |
Responses
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Invalid request body or query - every violation found (missing/invalid/unexpected fields) is reported in one response, semicolon-separated, not just the first one hit. |
| 403 | Missing or invalid API key |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | ||
name | string | ||
subject | string | ||
previewText | string | ||
tags | array of string | ||
onProjectCreation | string (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign) | ||
usedVariables | array of string | ||
usedComponents | array of string | ||
createdAt | string | ||
updatedAt | string |
Get a single template
GET /v1/projectId/{projectId}/templates/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
projectId | path | string | yes | The project _id, found in the app under Project Settings. |
id | path | string | yes |
Responses
| Status | Description |
|---|---|
| 200 | OK |
| 403 | Missing or invalid API key |
| 404 | Templates not found |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | ||
name | string | ||
subject | string | ||
previewText | string | ||
tags | array of string | ||
onProjectCreation | string (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign) | ||
usedVariables | array of string | ||
usedComponents | array of string | ||
createdAt | string | ||
updatedAt | string |
Partially update a template
PATCH /v1/projectId/{projectId}/templates/{id}
Merges the given fields into the existing document - omitted fields are left unchanged. Nothing is required (unlike create) since every field is optional on a partial update.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
projectId | path | string | yes | The project _id, found in the app under Project Settings. |
id | path | string | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ||
subject | string | ||
previewText | string | On PATCH, pass an empty string to clear it. | |
document | any | The template content. A Chamaileon visual-editor JSON document (type "chamaileon"): an object with a top-level "body". To change an existing design, GET the email/template, edit its document and send it back. To write one: {"body":{"type":"body","style":{"backgroundColor":"#f4f4f4"},"children":[fullwidth elements]}}. - A fullwidth element is {"type":"fullwidth","style":{"contentBackgroundColor":"#ffffff","contentPaddingTop":"20px",...},"children":[elements]} (600px wide). - Elements inside it: {"type":"text","attrs":{"text":"<h1>..</h1><p>..</p>"},"style":{"paragraphFontFamily":"Verdana, Geneva, sans-serif","paragraphColor":"#333333","paragraphFontSize":"16px","linkColor":"#0094c5","h1FontFamily":"Georgia, serif","h1Color":"#111111"}} (also h2/h3 FontFamily, Color, FontSize - set link colors here, an inline color on <a> is overridden), {"type":"button","attrs":{"text":"<p>Shop</p>","href":"https://.."},"style":{"backgroundColor":"#0094c5"}}, {"type":"image","attrs":{"src":"https://..","altText":"..","link":""},"style":{"width":"560px","maxWidth":"560px"}}, {"type":"divider"}, {"type":"social","attrs":{"elements":[{"type":"Facebook","link":"https://..","src":"img/Facebook/fb-3-colorful.png"}],"color":"colorful","iconSet":3}} (src is img/<network>/<prefix>-<iconSet>-<color>.png; iconSet 1-5; color colorful, black, grey or white; networks and prefixes: Blogger BL, Facebook fb, Instagram ig, Linkedin li, Medium ME, Pinterest PT, Snapchat SN, SoundCloud SC, Spotify SP, Telegram TG, TikTok tt, Tumblr TU, Twitter tw, Vimeo VI, Vkontakte VK, WeChat WC, YouTube YT), {"type":"box","style":{"backgroundColor":"..","paddingTop":"16px","borderRadius":"8px"},"children":[elements]}, columns {"type":"multicolumn","children":[{"type":"column","style":{"width":"280px"},"children":[elements]}, ...]} (widths add up to the space available), {"type":"typed-text","attrs":{"text":"Plain text"},"style":{"subType":"heading1","fontSize":"32px","color":"#111111","fontFamily":"Georgia, serif","align":"center","bold":true}} (subType paragraph, heading1-3 or list; takes plain text and its own style, while text takes HTML), {"type":"code","attrs":{"title":"Custom HTML","content":"<div style="font-size:16px">..</div>"}} (raw HTML, it must set its own font-size), {"type":"dynamic-image","attrs":{"src":"{{this.image.url}}","altText":".."},"style":{"width":"150px","height":"150px"}} (image URL from a merge tag), {"type":"video","attrs":{"videoId":"..","videoProvider":"youtube","link":"https://..","previewBaseUrl":"https://video.chamaileon.io/thumbnail/original/","thumbnailBaseUrl":"https://video.chamaileon.io/thumbnail/generated/"}} (thumbnail generated from the videoId; not in the app editor's toolbox). - Personalization: {"type":"loop","attrs":{"expression":"news.item limit=5 skip=0"},"children":[elements]} repeats its children per feed item (use {{this.title}} inside; add the feed in the feeds field), and {"type":"conditional","children":[{"type":"branch","attrs":{"type":"if","expression":"(EQ contact.plan "pro")"},"children":[elements]},{"type":"branch","attrs":{"type":"else"},"children":[elements]}]} (branch type if, else-if or else). block-level-loop and block-level-conditional work the same but sit directly in body and wrap whole fullwidth elements. - To give conditional branches different backgrounds, put a box with the background in each branch: the generator can apply the first branch's fullwidth colors to all branches. - Nesting: body holds only fullwidth and block-level-*; fullwidth, box, column, loop and branch hold elements; multicolumn holds only column; conditional holds only branch. - Colors, fonts and images can use a design system variable, e.g. "color":{"reference":"name","default":"#111111"} (see GET /v1/projectId/{projectId}/design-systems). - Every element needs a unique "eid" and style values are CSS strings with px units. The MCP server fills in any missing eid and the editor's default style/attrs keys for you; this API stores the document exactly as sent, so send complete elements (e.g. copy them from an existing document). - Merge tags like {{contact.name}} and {{unsubscribeLink}} work in text and links. Quote strings in them with single quotes, e.g. {{DEFAULT contact.url 'https://..'}}: double quotes break the generated src and href attributes. | |
tags | array of string | ||
onProjectCreation | string (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign) |
Responses
| Status | Description |
|---|---|
| 200 | OK |
| 400 | Invalid request body or query - every violation found (missing/invalid/unexpected fields) is reported in one response, semicolon-separated, not just the first one hit. |
| 403 | Missing or invalid API key |
| 404 | Templates not found |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | ||
name | string | ||
subject | string | ||
previewText | string | ||
tags | array of string | ||
onProjectCreation | string (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign) | ||
usedVariables | array of string | ||
usedComponents | array of string | ||
createdAt | string | ||
updatedAt | string |
Delete a template
DELETE /v1/projectId/{projectId}/templates/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
projectId | path | string | yes | The project _id, found in the app under Project Settings. |
id | path | string | yes |
Responses
| Status | Description |
|---|---|
| 200 | Deleted |
| 403 | Missing or invalid API key |
| 404 | Templates not found |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | ||
name | string | ||
subject | string | ||
previewText | string | ||
tags | array of string | ||
onProjectCreation | string (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign) | ||
usedVariables | array of string | ||
usedComponents | array of string | ||
createdAt | string | ||
updatedAt | string |