Email templates
GET /email-templates
List the organization's email templates, newest first by default. Supports filtering and cursor pagination.
Requires the settings:read permission.
Query parameters
limitnumberThe number of records to return.
cursorstringA pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.
sortname | -name | createdAt | -createdAt | type | -typeThe sort order. Prefix a field with - to sort descending. Defaults to -createdAt.
filterstringA JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, name, type, isDefault, createdAt. See Filtering for the syntax.
POST /email-templates
Create an email template. Its type decides which variables the body can use and cannot be changed afterwards. A layout is the shell every other type is sent inside. The first template of a type becomes its default. Triggers the emailTemplate.created webhook.
Requires the settings:write permission.
Body parameters
namestringrequiredThe template's display name.
bodystringrequiredThe email body. Use the variables the template's type provides.
typelayout | reviewSurveyrequiredWhich email the template is used for. It decides the variables the body can use. A layout is not sent on its own: it is the header, footer and branding every other type is rendered inside.
preheaderstringThe preview line an inbox shows after the subject. Ignored for a layout.
layoutIdstring | nullThe layout to send this template inside, or null for the default layout. Must be a template of type layout, and must be left out for a layout.
isDefaultbooleanMake this the default template of its type, in place of the current one. The first template of a type is its default whatever this says.
GET /email-templates/{id}
Get a single email template by ID.
Requires the settings:read permission.
Path parameters
idstringrequiredThe ID of the email template.
PUT /email-templates/{id}
Update an email template's name, body, preheader or layout, or make it the default of its type. The type is fixed at creation. Emails sent from here on use the new version. A default cannot be unset directly: make another template of the type the default instead. Triggers the emailTemplate.updated webhook.
Requires the settings:write permission.
Path parameters
idstringrequiredThe ID of the email template to update.
Body parameters
namestringThe template's display name.
bodystringThe email body.
preheaderstringThe preview line an inbox shows after the subject. Ignored for a layout.
layoutIdstring | nullThe layout to send this template inside, or null for the default layout. Must be a template of type layout, and must be left out for a layout.
isDefaultbooleanMake this the default template of its type, in place of the current one. The first template of a type is its default whatever this says.
DELETE /email-templates/{id}
Delete an email template. Deleting a default makes the oldest remaining template of the type the default, and templates sent inside a deleted layout move to the default layout. A template one of a loyalty program's member emails is set to use cannot be deleted: the request fails with a conflict until that email is pointed at another template. Triggers the emailTemplate.deleted webhook.
Requires the settings:write permission.
Path parameters
idstringrequiredThe ID of the email template to delete.