Skip to the documentation
API

Publish a version

Freezes the current draft and makes it what a send resolves.

POSTapi.openemail.uk/templates/{id}/versions

Runs the real call against your workspace, with your own key.

POST /templates/{id}/versions

Freezes the current draft and makes it what a send resolves.

Example

Needs templates:write. A POST to the version collection, because that is what it creates. Returns 201.

curl
curl -X POST "$OE/templates/order-shipped/versions" -H "$AUTH"
Response
{  "object": "template_version",  "id": "tplv_5d31c2a8…",  "templateId": "tpl_9c1f0a4b7e05d3862c1f0a44",  "version": 5,  "state": "published",  "engine": "html",  "subject": "Order {{orderId}} is on its way",  "slots": [],  "props": [{ "key": "orderId", "kind": "text", "required": true, "default": null }],  "publishedAt": "2026-08-30T11:02:19.000Z",  "createdAt": "2026-08-30T10:58:04.000Z",  "template": { "object": "template", "publishedVersion": 5, "latestVersion": 5 }}

The body is compiled here rather than at send time. A template that does not render fails for the person publishing it, which is the last moment it can fail in front of somebody who can fix it.

Idempotent. Publishing an already-published head returns it unchanged rather than minting an identical version, so a deploy script may call this every time it runs.

A body that references a key nothing declares is invalid_template, a 422, and nothing is published.