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.
{- "items": [
- {
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "",
- "description": "template description",
- "id": "48d63154-8c8f-4104-ab14-687d01dbf296",
- "name": "template.0",
- "version": null,
- "versions": null
}, - {
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "",
- "description": "template description",
- "id": "8d9c0f0d-7bf7-43a4-92a9-791a854d12a4",
- "name": "template.1",
- "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.
{- "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.
A 200 response
required | object |
required | object |
{- "paging": {
}, - "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": [
- {
- "active": false,
- "comment": "version comment",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "engine": "handlebars",
- "headers": { },
- "id": "71bd07b8-fe81-4199-8fcf-67c956ccdc34",
- "mjml": "",
- "tag": "v0",
- "template": ""
}, - {
- "active": true,
- "comment": "version comment",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "engine": "handlebars",
- "headers": { },
- "id": "d4a36e91-1b5f-44e0-bf5a-3542ea712b62",
- "mjml": "",
- "tag": "v1",
- "template": ""
}, - {
- "active": true,
- "comment": "version comment",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "engine": "handlebars",
- "headers": { },
- "id": "d4a36e91-1b5f-44e0-bf5a-3542ea712b62",
- "mjml": "",
- "tag": "v2",
- "template": ""
}
]
}
}
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.
{- "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": {
- "active": true,
- "id": "3efd2b85-0f41-4a1d-9898-05d7e7459c4a",
- "headers": {
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld",
- "Subject": "Subject Value"
}, - "tag": "tag",
- "template": "<html>template content</html>",
- "engine": "handlebars",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "comment": "Version comment"
}
}
}
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.
{- "template": {
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value",
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "version": {
- "comment": "Version comment",
- "active": true,
- "id": "3efd2b85-0f41-4a1d-9898-05d7e7459c4a",
- "headers": {
- "Subject": "Subject Value",
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld"
}, - "tag": "tag",
- "template": "<html>template content</html>",
- "engine": "handlebars",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC"
}, - "name": "template_name",
- "description": "This is the description of the template"
}
}
Delete the template specified in the url. NOTE: This method deletes all versions of the specified template.
{- "template": {
- "name": "template_name"
}, - "message": "template has been deleted"
}
Retrieve the information and content of the specified version of a template.
{- "template": {
- "id": "46565d87-68b6-4edb-8b3c-34554af4bb77",
- "version": {
- "headers": {
- "From": "from@header.tld",
- "Reply-To": "reply-to@header.tld",
- "Subject": "Subject Value"
}, - "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"
}, - "name": "template_name",
- "description": "This is the description of the template",
- "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC",
- "createdBy": "user-supplied-value"
}
}
Update information or content of the specific template version. Existing fields not included in the request will not be changed
{- "template": {
- "name": "template_name",
- "version": {
- "tag": "tag"
}
}, - "message": "version has been updated"
}
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 of a different tag name.
{- "message": "version has been deleted",
- "template": {
- "name": "template_name",
- "version": {
- "tag": "tag"
}
}
}