Skip to main content
PATCH
cURL

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

Body

application/json

Only provided fields are changed - an omitted field leaves the existing value unchanged. Supplying both html and mjml in the same request is rejected, as is an update that would leave the template with no html or text content. Supply version to make the update conditional - without it, the last write wins.

name
string

Renames the template. Cannot be cleared. Maximum 64 characters.

subject
string

Cannot be cleared. Maximum 256 characters.

html
string | null

Replaces the html, and clears any stored mjml (switching the template back to plain HTML authoring). Set to null to remove the html - blank values are rejected. Maximum 500,000 characters.

mjml
string | null

Replaces the mjml source, recompiling the html from it. Set to null to remove the mjml source while keeping the html already compiled from it - blank values are rejected. Maximum 500,000 characters, and the compiled html must also be within the html limit.

text
string | null

Replaces the plain text content. Set to null to remove it - blank values are rejected. Maximum 100,000 characters.

channelIds
string<uuid>[] | null

Replaces the channels the template is scoped to. Set to null or an empty array to remove channel scoping, making the template available to every channel in the account.

version
integer<int64>

The version of the template the update was based on, as returned by a previous read. If the template has since been modified the update is rejected with 409 Conflict, so concurrent edits aren't silently overwritten.

Response

OK

id
string<uuid>
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
version
integer<int64>
required

Opaque version, changing on every update. Pass it back as the version of an update to have the update rejected if the template has been modified in the meantime.

name
string
required
subject
string
required
html
string
mjml
string
text
string
channelIds
string<uuid>[]