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

NameInTypeRequiredDescription
projectIdpathstringyesThe project _id, found in the app under Project Settings.
limitqueryintegerMax items per page. Capped at 30.
skipqueryintegerNumber of items to skip, for pagination.
sortquerystringField to sort by.
orderquerystring
filter[<field>]querystringExact-match filter on a top-level field, e.g. filter[name]=Welcome. Repeatable for multiple fields.

Responses

StatusDescription
200OK
403Missing or invalid API key

Response body

FieldTypeRequiredDescription
itemsarray
countintegerTotal matching items across all pages, not just this page.
nextstringFull 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

NameInTypeRequiredDescription
projectIdpathstringyesThe project _id, found in the app under Project Settings.

Request body

FieldTypeRequiredDescription
namestringyes
subjectstringyes
previewTextstringOn PATCH, pass an empty string to clear it.
documentanyyesThe template content document (Chamaileon JSON).
tagsarray of string
onProjectCreationstring (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign)

Responses

StatusDescription
201Created
400Invalid request body or query - every violation found (missing/invalid/unexpected fields) is reported in one response, semicolon-separated, not just the first one hit.
403Missing or invalid API key

Response body

FieldTypeRequiredDescription
_idstring
namestring
subjectstring
previewTextstring
tagsarray of string
onProjectCreationstring (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign)
usedVariablesarray of string
usedComponentsarray of string
createdAtstring
updatedAtstring

Get a single template

GET /v1/projectId/{projectId}/templates/{id}

Parameters

NameInTypeRequiredDescription
projectIdpathstringyesThe project _id, found in the app under Project Settings.
idpathstringyes

Responses

StatusDescription
200OK
403Missing or invalid API key
404Templates not found

Response body

FieldTypeRequiredDescription
_idstring
namestring
subjectstring
previewTextstring
tagsarray of string
onProjectCreationstring (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign)
usedVariablesarray of string
usedComponentsarray of string
createdAtstring
updatedAtstring

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

NameInTypeRequiredDescription
projectIdpathstringyesThe project _id, found in the app under Project Settings.
idpathstringyes

Request body

FieldTypeRequiredDescription
namestring
subjectstring
previewTextstringOn PATCH, pass an empty string to clear it.
documentanyThe template content document (Chamaileon JSON).
tagsarray of string
onProjectCreationstring (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign)

Responses

StatusDescription
200OK
400Invalid request body or query - every violation found (missing/invalid/unexpected fields) is reported in one response, semicolon-separated, not just the first one hit.
403Missing or invalid API key
404Templates not found

Response body

FieldTypeRequiredDescription
_idstring
namestring
subjectstring
previewTextstring
tagsarray of string
onProjectCreationstring (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign)
usedVariablesarray of string
usedComponentsarray of string
createdAtstring
updatedAtstring

Delete a template

DELETE /v1/projectId/{projectId}/templates/{id}

Parameters

NameInTypeRequiredDescription
projectIdpathstringyesThe project _id, found in the app under Project Settings.
idpathstringyes

Responses

StatusDescription
200Deleted
403Missing or invalid API key
404Templates not found

Response body

FieldTypeRequiredDescription
_idstring
namestring
subjectstring
previewTextstring
tagsarray of string
onProjectCreationstring (do-nothing | set-as-transactional | set-as-triggered | set-as-campaign)
usedVariablesarray of string
usedComponentsarray of string
createdAtstring
updatedAtstring