This API allows you to store predefined templates and use them to send messages using the Sending API.
Returns a list of templates for the domain.
A 200 response
required | Array of objects |
required | object |
{- "items": [
- {
- "name": "template.0",
- "description": "template description",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "",
- "id": "48d63154-8c8f-4104-ab14-687d01dbf296",
- "version": null,
- "versions": null
}, - {
- "name": "template.1",
- "description": "template description",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "",
- "id": "8d9c0f0d-7bf7-43a4-92a9-791a854d12a4",
- "version": null,
- "versions": null
}
], - "paging": {
}
}
Store a new template, including its name, description and (optionally) the template content. If the template content is provided, a new version is automatically created and becomes the active version.
name required | string Name of the template being stored. Supports utf-8 characters and name will be down cased. |
description | string Description of the template being stored |
createdBy | string Optional metadata field api user can indicate who created the template. |
template | string Content of the template. |
tag | string Initial tag of the created version. If the template parameter is provided and the tag is missing, the default value |
comment | string Version comment. This is valid only if a new version is being created. (template parameter is provided.) |
headers | string Key Value json dictionary of headers to be stored with the template. Where key is the header name and value is the header value. The header names Headers set at the message level will override headers set on the template. e.g. Setting the From header at the time of sending will override the From header saved on the template. Additionally, headers generated by templates are not reflected on the accepted event as they are not prepended to the message until the message is prepped for delivery. if a From header is not provided either in the message or template, we will default to |
{- "message": "template has been stored",
- "template": {
- "name": "template_name",
- "description": "This is the description of the template",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value",
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "version": {
- "tag": "tag",
- "template": "<html>template content</html>",
- "engine": "handlebars",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "Version comment",
- "active": true,
- "id": "3efd2b85-0f41-4a1d-9898-05d7e7459c4a",
- "headers": {
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld",
- "Subject": "Subject Value"
}
}
}
}
Returns a paginated list of template versions.
page | string Name of the page to retrieve. Value can be
| ||||||||||
limit | integer Number of templates to retrieve. Default and max limit is 100. | ||||||||||
p | string Pivot used to retrieve the next page of templates. |
A 200 response
required | object |
required | object |
{- "template": {
- "name": "template_name",
- "description": "This is the description of the template",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value",
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "versions": [
- {
- "tag": "v0",
- "template": "",
- "engine": "handlebars",
- "mjml": "",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "version comment",
- "active": false,
- "id": "71bd07b8-fe81-4199-8fcf-67c956ccdc34",
- "headers": { },
- "parsedhandlebar": null
}, - {
- "tag": "v1",
- "template": "",
- "engine": "handlebars",
- "mjml": "",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "version comment",
- "active": true,
- "id": "d4a36e91-1b5f-44e0-bf5a-3542ea712b62",
- "headers": { },
- "parsedhandlebar": null
}, - {
- "tag": "v2",
- "template": "",
- "engine": "handlebars",
- "mjml": "",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "version comment",
- "active": true,
- "id": "d4a36e91-1b5f-44e0-bf5a-3542ea712b62",
- "headers": { },
- "parsedhandlebar": null
}
]
}, - "paging": {
}
}
Adds a new template version. If the template doesn’t contain any other versions, the first version becomes active. A template can store up to 40 versions.
template required | string Content of the template. |
tag required | string Tag of the version that is being created. Must be unique to the template. |
comment | string Comment related to the version that is being created. |
active | string If this flag is set to yes, this version becomes active |
headers | string Key Value json dictionary of headers to be stored with the template. Where key is the header name and value is the header value. The header names Headers set at the message level will override headers set on the template. e.g. Setting the From header at the time of sending will override the From header saved on the template. Additionally, headers generated by templates are not reflected on the accepted event as they are not prepended to the message until the message is prepped for delivery. if a From header is not provided either in the message or template, we will default to |
{- "message": "new version of the template has been stored",
- "template": {
- "name": "template_name",
- "description": "This is the description of the template",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value",
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "version": {
- "tag": "tag",
- "template": "<html>template content</html>",
- "engine": "handlebars",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "Version comment",
- "active": true,
- "id": "3efd2b85-0f41-4a1d-9898-05d7e7459c4a",
- "headers": {
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld",
- "Subject": "Subject Value"
}
}
}
}
Returns metadata information about the stored template specified in the url. If the active flag is provided, the content of the active version of the template is returned.
A 200 response
{- "template": {
- "name": "template_name",
- "description": "This is the description of the template",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value",
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "version": {
- "tag": "tag",
- "template": "<html>template content</html>",
- "engine": "handlebars",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "Version comment",
- "active": true,
- "id": "3efd2b85-0f41-4a1d-9898-05d7e7459c4a",
- "headers": {
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld",
- "Subject": "Subject Value"
}
}
}
}
Delete the template specified in the url. NOTE: This method deletes all versions of the specified template.
{- "message": "template has been deleted",
- "template": {
- "name": "template_name"
}
}
Retrieve the information and content of the specified version of a template.
A 200 response
{- "template": {
- "name": "template_name",
- "description": "This is the description of the template",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value",
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "version": {
- "tag": "tag",
- "template": "<html>template content</html>",
- "engine": "handlebars",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "Version comment",
- "active": true,
- "id": "3efd2b85-0f41-4a1d-9898-05d7e7459c4a",
- "headers": {
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld",
- "Subject": "Subject Value"
}
}
}
}
Update information or content of the specific template version. Existing fields not included in the request will not be changed
template | string Content of the template. |
comment | string Comment related to the version that is being created. |
active | string If this flag is set to yes, this version becomes active |
headers | string Key Value json dictionary of headers to be stored with the template. Where key is the header name and value is the header value. The header names |
{- "message": "version has been updated",
- "template": {
- "name": "template_name",
- "version": {
- "tag": "tag"
}
}
}
Delete a specific template version.
{- "message": "version has been deleted",
- "template": {
- "name": "template_name",
- "version": {
- "tag": "tag"
}
}
}
Copies an existing version into a new version with the provided name.
domain_name required | string Domain name the template is associated with. |
template_name required | string template name the version is stored under. |
version_name required | string Tag of the version to copy. |
new_version_name required | string The name for the new version. If the version name already exists, it will be overridden. |
{- "message": "version has been copied",
- "version": {
- "tag": "cloned version",
- "template": "<p>{{firstname}} {{lastname}}</p>",
- "engine": "handlebars",
- "createdAt": "Fri, 21 Mar 2025 15:00:44 UTC",
- "comment": "a comment value from copy",
- "id": "95658c55-e93a-40d5-a02f-a4fadfbbb3ca"
}
}