Skip to main content
Manage your project’s templates without opening the app. Useful when your emails live in your own system and you want to version them there, or when you send via API and never open the editor. A template created via API works exactly like one created in the app: send it with POST /v1/send-template-email and open it in the visual editor whenever you want.

Authentication

All requests require a Bearer token:
See Public API v1 for details.

Endpoints

POST /v1/templates

Creates a template from HTML. The HTML is stored as you send it: we don’t rewrite it or inject styles. It can include variables ({{first_name}}) — they’re substituted at send time, not at creation.
Keep the id or the internal_id: those are the two identifiers send-template-email accepts. The internal_id is a short per-project number, handy if you’ll write it by hand in your config.

GET /v1/templates

Lists the project’s templates, most recently updated first.
The list does not include the HTML (a page of 50 templates would be megabytes of response). The html field comes back empty; fetch the individual template to get the body.

GET /v1/templates/:id

Returns a template with its HTML. The :id can be the UUID or the numeric internal_id.

PUT /v1/templates/:id

Updates a template. Send only the fields that change: name, html, subject, description, or preheader.
Changes apply to subsequent sends. Already-sent emails are not modified.

DELETE /v1/templates/:id

Deletes a template.
If the template is in use by a campaign or an automation step, the response is 409 and nothing is deleted:
?force=true deletes it anyway. The automations and campaigns that used it are left without content and their sends will go out empty: point them at another template before forcing.

Error codes


Sending the template

Variables, loops, and helpers are covered in Templates and variables.