Skip to Content
Docs
API referenceTemplates

Create a new template version

POST
/v1/templates/{alias}/versions

Each call creates a new immutable version. When activate (default true), every other version is deactivated first — POST /v1/email's template_alias rendering always uses the single active version. A key with guardrails may only save drafts (activate: false); activating responds 403 policy_violation, policy_template_activation_not_allowed.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <key>. Looked up by SHA-256 hash (email_core::sha256_hex) against api_keys.hash; revoked keys and keys belonging to a suspended tenant are rejected. See the top-level Authentication section for permission levels.

Path Parameters

alias*string

Request Body

application/json
  1. body
subject*string
html_body?string
text_body?string
activate?boolean
Defaulttrue

Response Body

Version created.

application/json
  1. response
version?integer

1-based, monotonically increasing per template.

active?boolean
Example Request
curl -X POST 'https://api.emitd.com/v1/templates/string/versions' \  -H 'Content-Type: application/json' \  -d '{  "subject": "string"}'
Example Response
{  "version": 0,  "active": true}