v1.0.0
OpenAPI 3.1.0

Preview an email

US region

Client Libraries

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.

Path Parameters
  • id
    Type: string Format: uuid
    required

    The UUID of the email. If your email has translations, this is the ID of a specific language variant.

Body
application/json

All fields are optional.

  • campaign
    Type: object

    Campaign metadata for {{campaign.*}}.

  • customer
    Type: object

    Customer profile attributes for {{customer.*}} variables.

  • event
    Type: object

    Event attributes for {{event.*}}.

  • journey
    Type: object

    Journey metadata for {{journey.*}}.

  • lax
    Type: boolean

    Set to true if 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.

  • message
    Type: object

    Message metadata for {{message.*}}.

  • objects
    Type: object

    Related objects for {{objects.*}}.

  • trigger
    Type: object

    Trigger data for {{trigger.*}}.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/design_studio/emails/{id}/preview
{
  "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>"
}