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 document (Chamaileon JSON). |
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 document (Chamaileon JSON). | |
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 |