Update Template
Update an existing email template. Changing mjml recompiles the stored HTML.
A production key updating a test-only template promotes it (test_only becomes false). A test key cannot update a production template (403).
/templates/:template_id
/templates/template_01k3tgwp77eh6by9v79627fjsm
Path Parameters
The ID of the template to update.
Body Parameters
A unique name for the template on this domain.
MJML source. Compiled to HTML in the email. Required unless content is provided.
HTML (or plain text). Required unless mjml is provided. Do not send with mjml.
Default From address used when sending if the send request omits from.
Default recipients used when sending if the send request omits to.
Default subject used when sending if the send request omits subject.
Note
mjml,content, andsubjectcan have dynamic content using our template language
Example
curl -X PATCH https://api.mailcast.io/v1/templates/:template_id \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d $'{
"name": "welcome-updated",
"mjml": "<mjml><mj-body><mj-section><mj-column><mj-text>Hi {{name}}</mj-text></mj-column></mj-section></mj-body></mjml>",
"subject": "Hi {{name}}"
}'
{
"template_id": "template_01k3tgwp77fq3avde371cyk598",
"name": "welcome-updated",
"mjml": "<mjml><mj-body><mj-section><mj-column><mj-text>Hi {{name}}</mj-text></mj-column></mj-section></mj-body></mjml>",
"from": "hello@example.com",
"to": null,
"subject": "Hi {{name}}",
"test_only": false,
"created_at": "2025-08-29T12:00:00Z",
"updated_at": "2025-08-29T13:30:00Z"
}