Skip to Content
Docs
API referenceTemplates

Render a template without sending

POST
/v1/templates/{alias}/preview

Runs the same substitution a send runs. Returns the rendered subject and bodies, the required variables the model is missing, and deliverability warnings. An empty body renders the saved sample against the active version. {{unsubscribe_url}} and {{year}} are filled in for each recipient when the email is sent, so they stay as written here unless the model supplies them.

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
model?

Values to render with. Omitted → the template's saved sample.

version?integer

Render this version instead of the active one.

Response Body

Rendered preview.

application/json
  1. response
version?integer
subject?string
html_body?string|null
text_body?string|null
missing?array<string>

Required variables the model did not supply.

warnings?array<>
size_bytes?integer
Example Request
curl -X POST 'https://api.emitd.com/v1/templates/string/preview' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "version": 0,  "subject": "string",  "html_body": "string",  "text_body": "string",  "missing": [    "string"  ],  "warnings": [    {      "code": "string",      "message": "string",      "severity": "error",      "detail": "string"    }  ],  "size_bytes": 0}