A valid request URL is required to generate request examples{
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"key": "<string>",
"variables": [
"<string>"
],
"version": 123,
"channel": "email",
"subject": "<string>",
"body": "<string>",
"url": "<string>",
"category": "marketing",
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"system_key": "<string>",
"system": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Update a message template
Requires messaging:manage. Partial: omit a field to leave it alone.
The compile runs on the merged pair, not on what you sent. An edit that only changes the subject is still checked against the body it will go out with, so a template cannot become unrenderable one field at a time.
channel cannot change. The channel decides which columns mean anything — an email needs a subject and an in-app notification has none — so moving a row between them would have to invent or discard one in the same write. A template for another channel is another template.
archived is both the archive and the restore. The restore lives here rather than behind a verb of its own because it is not a delete: an undo belongs where a field goes back to a previous value.
A valid request URL is required to generate request examples{
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"key": "<string>",
"variables": [
"<string>"
],
"version": 123,
"channel": "email",
"subject": "<string>",
"body": "<string>",
"url": "<string>",
"category": "marketing",
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"system_key": "<string>",
"system": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Authorizations
A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.
Headers
The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.
Path Parameters
Body
200marketing, product_news, surveys Only on an email template.
500100000How your backend addresses this template. An empty string clears it, which a transactional template cannot do — it is addressed by name and may not be a campaign step.
100The declaration this body may read — a plain name, or a list with its columns. Changing it writes a new version along with the body, because a variable added and the body that reads it are one edit.
Make an earlier version live again. The newer ones stay on the shelf — going forward is the same call with a higher number.
It cannot be combined with an edit to the words: a request that both rewrites and rolls back is one we would have to guess about, and that is a 400.
true takes it out of the picker, false puts it back. Archiving twice does not move the timestamp.
Optional, and in_app only. Where the notifications this template produces lead when somebody acts on one.
A path rooted at / or an absolute http/https URL — nothing else, and never a scheme that executes. Refused on email for the same reason a subject is refused on in_app: an email body here is your own text escaped into our shell, with no call to action for a URL to attach to.
Send "" to clear it: leaving a destination alone and removing one are different edits, and a PATCH that omits the field does the first.
2048Response
The template.
The words this product sends, written once and rendered per person — by a campaign, and since 00165 by POST /v1/notifications too, which addresses it by key and supplies its variables. Per environment, so writing it in test and copying it to live is the obvious workflow rather than a rename.
Show child attributes
Show child attributes