The plain text body. null removes it, so sends fall back to text made from the HTML.
Update a template
Save a new version of a stored template.
/v1/templates/{name}API keyEvery update creates a new version: version goes up by one and the previous content stays in the version history, so you can restore it later. Sends pick up the new version straight away, and each email records the version it was rendered with (templateVersion).
Send only the fields you want to change. The name can't be changed.
Only stored templates can be updated. Built-in templates are read-only and return 404 template_not_found here. To change one for your project, create a stored template with the same name; it replaces the built-in one.
Concurrent edits
If someone else saves the same template between the moment your update reads it and the moment it writes, the update fails with 409 template_conflict and nothing is saved. Fetch the template again and retry.
Path parameters
The template name.
Body parameters
1 to 998 characters.
The HTML body. Can't be empty.
Replaces the whole list. Each entry is { name, required?, example? }. See Create a template.
Response
The template with its new version. Same fields as Retrieve a template.
Errors
| Status | Code | When |
|---|---|---|
| 400 | missing_body | The request has no body. |
| 400 | invalid_body | A field is malformed. param names the field. |
| 400 | invalid_template | A syntax error. param is subject, html or text. |
| 404 | template_not_found | No stored template with this name. Built-in templates also return this. |
| 409 | template_conflict | The template changed while this update ran. |