Get an email template preview
Renders a template with the sample values you supply and returns the resulting subject, HTML, and plain-text bodies. Bird does not issue a recipient-specific unsubscribe URL in a preview. If you supply bird.unsubscribe_url in parameters, the preview renders your value; an empty link is not live. Bird adds unsubscribe content to marketing email at send time; transactional email gets no automatic unsubscribe footer. By default it renders the current draft, so you can check your changes before you submit it. Pass version to preview a specific published version instead; built-in system templates have no versions, so version on a bird_ template returns a validation error. Pass contact to see the email the way one of your contacts would receive it. Works for your workspace templates and built-in system templates. Sample parameters are capped at 16 KB once serialized, and personalization that is not valid or not supported returns a validation error naming what to fix. The response also reports what the HTML uses that mail clients remove, ignore, or render inconsistently. Each finding in compatibility names the pattern, the line and column it sits on, and what to use instead, and compatibility_severity reduces them to one word for the whole body. It is advisory: the preview renders either way.
Request
- Base URL: https://us1.platform.bird.com
- URL: https://us1.platform.bird.com/v1/email/templates/{template_ref}/preview
- Auth: one of:
- HTTP bearer
- API key in cookie bird_session
Headers
Client-supplied key. On operations supporting request deduplication, a retained response is replayed for duplicate requests with the same key within the idempotency window (3 hours by default). This protection requires a workspace, organization, or staff-account scope. User-only and unscoped unauthenticated operations, streams, and operations with a separate replay contract do not use this response replay.
On a supported operation, if idempotency protection is unavailable before execution, the API returns 503 IdempotencyUnavailable (E01033) without executing this attempt. Retry with backoff using the same key and request. An operation that takes effect before its response is retained can still execute again on retry.
Two distinct 409 errors signal misuse:
- request_in_progress (E01004): The same key is currently being processed by a concurrent request. Wait briefly and retry. The lock expires within 30 seconds.
- idempotency_key_reuse (E01005): The same key has already completed against a different request body or method. Generate a new key.
Recommended key format is <event-type>/<entity-id> (for example welcome-user/usr_abc123).
Workspace context for the request. Required for dashboard authentication and master keys. Workspace keys and access tokens already identify their workspace; send that workspace or omit the header. A different one is rejected.
Organization context for the request. Required for dashboard authentication. An API key or access token carries its own organization, so send either that organization or no header at all; a different one is rejected.
Request body
Example request
{
"content": {
"subject": "Welcome to Acme, {{ bird.contact.first_name }}!",
"preview_text": "{{ bird.contact.first_name }}, your order is on its way",
"html": "<h1>Hi {{ bird.contact.first_name }}</h1>"
},
"parameters": {
"bird": {
"contact": {
"first_name": "Ada"
}
},
"animal": "otter"
},
"contact": "con_01krdgeqcxet5s7t44vh8rt9mg",
"language": "pt-BR",
"version": "emv_01krdgeqcxet5s7t44vh8rt9mg"
}Response
The rendered preview.
Example response
{
"language": "pt-BR",
"compatibility_severity": "warning",
"compatibility": [
{
"rule_id": "css_display_flex_grid",
"severity": "warning",
"language": "pt-BR",
"field": "html",
"message": "`display: flex` and `grid` don't work in Outlook (Windows/Windows Mail).",
"fix": "Use tables for layout.",
"partial": "Partial support for `display: flex` and `grid` in Gmail (iOS/Android).",
"line": 14,
"column": 6,
"match": "display: flex",
"unsupported_clients": [
{
"family": "outlook",
"platforms": [
"windows",
"windows_mail"
]
}
],
"partial_clients": [
{
"family": "outlook",
"platforms": [
"windows",
"windows_mail"
]
}
]
}
]
}Changes
No recorded changes to this operation across all 2 revisions of this API.