POST /v1/templates/preview
To render a template you’ve already saved, use POST /v1/templates//render instead, which references it by id.
Body parameters
All fields are optional — send the draft fields you want to render.Draft subject line with merge variables.
Draft HTML body.
Draft plain-text body.
Merge variables to substitute. HTML values are escaped before insertion into the
html field.Request
Response
The rendered subject.
The rendered HTML, or
null when not supplied or on a syntax error.The rendered text, or
null.Referenced variables absent from
data.Present only when a draft field has a template syntax error. The request still returns
200 OK so the editor can show the message inline.200 OK
Syntax error
A malformed block (e.g. an unclosed{{#if}}) returns 200 with an error string rather than a 4xx, so a live editor can surface it without treating it as a failed request.
200 OK · with error
HTML escaping. Values in
data are HTML-escaped before substitution into html. Use the triple-brace {{{raw}}} form only for values you trust to be safe markup.