Skip to content

Render template​

POST
/api/v1/templates/{id}/render

Renders the stored template against a runtime context and returns one self-contained HTML string, with the rendered subject beside it. The subject is made safe for a single email header line: line breaks, other whitespace runs and control characters collapse to one space, the ends are trimmed, and it is cut to 998 characters, so a context value cannot add a header. target picks between browser (default) and email; wrap picks between a full document (default) and a fragment. When target is email, the response also includes a text plain-text alternative for the text part of a multipart message.

Authorizations​

ApiKeyAuth

Long-lived account credential. Create one from the dashboard.

Type
API Key (header: x-api-key)
or
BearerAuth

Short-lived presigned token scoped to a single template (minted via /presigned-url).

Type
HTTP (bearer)

Parameters​

Path Parameters

id*
Type
string
Required
Example"bonipyZlnbwtYVSzQO3AA"

Request Body​

application/json

Structural JSON value: object or array. Scalars and null are rejected.

Valid values"browser""email"
Valid values"document""fragment"

Responses​

Rendered HTML.

application/json

Plain-text alternative. Present only when target is "email".

The subject line rendered against the context, or null when the template has none or it renders to nothing. It is safe to pass as a single header line: every run of line breaks, other whitespace or control characters becomes one space, the ends are trimmed, and it is cut to 998 characters.

When the published copy this render came from last changed. A caller that keeps something derived from a template, such as a review of its content, can compare this against the value it stored instead of fetching the template again.

Playground​

Authorization
Variables
Key
Value
Body

Samples​