Skip to content

mail_template_update

Update a template.

Tool

mail_template_update

Update a template.

Update a template. The edit lands in its open draft revision; the live body only changes on publish

Behavior

HTTP
PATCH /mail/templates/:id

Arguments

Name
Type
Required
Description
id
string
•
Template id
html
string
—
New HTML body; unchanged when omitted
name
string
—
New human label; unchanged when omitted
text
string
—
New plaintext body; null clears it and it is re-derived from html. Unchanged when omitted
subject
string
—
New email subject; may contain {{ variable }} placeholders. Unchanged when omitted
variables
array
—
Replacement list of declared variables ([{name,type,optional,fallback}], <=20). Unchanged when omitted

Response

Field
Type
Always
Description
id
string
•
Template id
html
string
•
HTML body; may contain {{ variable }} placeholders
name
string
•
Human label for the template
text
string
•
Plaintext body; null when none was supplied
status
string
•
Lifecycle status: published once a revision has gone live
subject
string
•
Email subject; may contain {{ variable }} placeholders
createdAt
string
•
When the template was created (ISO 8601 UTC)
updatedAt
string
•
When the template was last modified (ISO 8601 UTC)
variables
array
•
Declared variables of this template (at most 20)
archivedAt
string
•
When the template was archived (ISO 8601 UTC); null while it is listed normally. Archiving never stops a send
draftRevision
integer
•
Revision number of the open, unpublished draft; null when there is none
currentRevision
integer
•
Revision number a send renders; null until the template is first published

Try it

Update a template.

When to use

Update a template. The edit lands in its open draft revision; the live body only changes on publish

Example

Ask your agent something like this:

Update a template.

The agent will invoke mail_template_update with these arguments:

{
  "id": "<id>"
}

Esc

Start typing to search the docs.

↑↓navigate↵select