Preview an email
Returns an email with liquid fully evaluated against data you provide. The response includes the final HTML as a recipient would see it, along with liquid errors.
Omit the body or send {} to render your fallback values: a variable with a default filter renders its fallback, and each variable without one reports an error in the response's errors object.
The render, preview, review, link, and publish endpoints share a rate limit of 5 requests per second per workspace.
- Type: string Format: uuididrequired
The UUID of the email. If your email has translations, this is the ID of a specific language variant.
All fields are optional.
- Type: objectcampaign
Campaign metadata for
{{campaign.*}}. - Type: objectcustomer
Customer profile attributes for
{{customer.*}}variables. - Type: objectevent
Event attributes for
{{event.*}}. - Type: objectjourney
Journey metadata for
{{journey.*}}. - Type: booleanlax
Set to
trueif you want undefined variables to resolve to an empty string instead of reporting an error; this can help you focus on more important errors when you don't provide sample data or fallback values. Liquid syntax errors (like broken tags and invalid filters) are always reported as errors. - Type: objectmessage
Message metadata for
{{message.*}}. - Type: objectobjects
Related objects for
{{objects.*}}. - Type: objecttrigger
Trigger data for
{{trigger.*}}.
- application/json
- application/json
- application/json
- application/json
{
"customer": {
"first_name": "Jane",
"email": "jane@example.com",
"plan": "enterprise"
},
"event": {
"name": "order_completed",
"total": 149.99
}
}
{
"errors": {
"bcc": [],
"body": [],
"body_amp": [],
"body_plain": [],
"cc": [],
"event": [],
"from": [],
"layout": [],
"message": [],
"preheader_text": [],
"reply_to": [],
"snippets": [],
"subject": [],
"to": [],
"trigger": []
},
"from": "\"No reply\" <noreply@example.com>",
"html": "<!DOCTYPE html>...<p>Purchase info</p>...",
"links": [
{
"errors": [],
"text": "View your order",
"tracked": true,
"url": "https://example.com/orders"
}
],
"node_id": "1a0cbb4e-09d3-402e-949e-f6732f021650",
"node_type": "EMAIL",
"plaintext_body": "Thanks for your recent purchase!",
"subject": "Order Confirmation",
"text": "<html><head></head><body style=\"margin:0\"><div style=\"font-size:16px;line-height:1.5;font-family:Arial,Helvetica,sans-serif;white-space:pre-wrap;padding:10px;\">Thanks for your recent purchase!</div></body></html>"
}Successful response