PUT/api/v1/projects/{project_id}/templates/{template_id}
Needs scope: writeMCP tool: update_template
operationId update_template
Save a new version of a template
Saves the sources as the template’s next version (the latest version’s
number plus one), checked as at creation. Every save is a version. The
name and the kind stay. Needs scope write.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
project_idrequired |
path | string · uuid | The project’s id |
template_idrequired |
path | string · uuid | The template’s id |
Request body
application/json · required
- UpdateTemplateRequest object
-
html_bodystringrequiredThe HTML body, as at creation.
-
subjectstring | nullThe subject, as at creation.
-
text_bodystring | nullThe text body;
nullor left out: made from the HTML.
Responses
200
The new version
- Template object · all fields required
-
created_atstring · date-timeWhen this version was saved.
-
engineTemplateEngineThe template engine.
- minijinja
-
html_bodystring -
idstring · uuidThe template’s id, the same in every version.
example
01900000-0000-7000-8000-000000000001 -
kindTemplateKindWhat a template is.
- message
- partial
-
namestringexample
Welcome -
project_idstring · uuid -
subjectstring | nullnullfor a partial. -
text_bodystring | nullnull: the text is made from the HTML when the message is sent. -
versioninteger · int32From 1, one more at each save.
≥ 1 · example
2
404
No such project or template in it, or another project’s (not_found)
409
The project is deleted, or another save took the version number at the same moment (conflict)
422
Invalid fields or sources, every one in errors (validation_failed), as at creation
429
The key is over its rate limit, api.rate_limit_per_minute requests a minute on this node (rate_limited)
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds until the key’s next request passes; rounded up. |
504
Postwind’s storage did not answer within its time limit (storage_timeout). A change the request makes may still take effect: check before repeating it. A repeat with the same Idempotency-Key never runs it twice: it is 409 idempotency_key_in_progress until the key’s 24 h end