email-broadcasts

Preview a broadcast for a contact

Render the template's published content using the saved broadcast, the changes supplied in this request and contact values the caller can read. Supplied fields replace the saved values for this preview only. Requires template read permission. Supply contact_id when the template uses contact data. The preview's unsubscribe link does not unsubscribe a contact. This does not send mail. Each call renders a fresh result. An Idempotency-Key header is accepted but does not replay an earlier preview.

post/v1/email/broadcasts/{broadcast_id}/preview

Request

  • Base URL: https://us1.platform.bird.com
  • URL: https://us1.platform.bird.com/v1/email/broadcasts/{broadcast_id}/preview
  • Auth: one of:
    • HTTP bearer
    • API key in cookie bird_session

Path parameters

broadcast_idstring required
Example:eb_01krdgeqcxet5s7t44vh8rt9mg

Broadcast identifier.

Headers

Idempotency-Keystring

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).

X-Workspace-Idstring

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.

X-Organization-Idstring

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

headersEmailBroadcastHeaders

Custom email headers as name and value pairs. Up to 25 of them, each value up to 998 characters.

contact_idstring

Example request

{
  "template": {
    "id": "emt_01krdgeqcxet5s7t44vh8rt9mg",
    "language": "pt-BR"
  },
  "from": "Jane Doe <jane@acme.com>",
  "reply_to": [
    "Jane Doe <jane@acme.com>"
  ],
  "headers": {
    "X-Campaign": "spring-launch"
  },
  "contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg"
}

Response

Rendered broadcast preview.

contact_idstring
subjectstring required

The rendered subject line.

preheaderstring required

The text of the hidden preview block that this render of html includes, which inbox clients can show beside the subject. It is empty when the template has no preview text, when the text renders empty, or when the rendered HTML does not include the block. A version published earlier can have preview text whose block its markup leaves out, escapes or removes; publishing the template again places the block. This value describes the rendered HTML and does not show how a provider or inbox displays it. Use it instead of reading the hidden block in html.

htmlstring required

The rendered HTML body. When preheader is not empty, it includes the hidden block that carries that text.

textstring required

The rendered plain-text body.

resolved_parametersEmailBroadcastResolvedParameters required

The broadcast inputs this render used, by name, each with the string, number, boolean or null value it used. It holds the values taken from template.parameters or the selected language's template.parameter_overrides entry, and only for names the rendered content or envelope uses. Contact values are never included. A number keeps the digits it was supplied with.

preview_fingerprintstring required

An opaque value for this rendered content. It changes when the published version, an input, a contact value, a fallback or the envelope changes. To send this content as a test, repeat the same inputs with this value. Do not parse it.

Example response

{
  "resolution": {
    "template_id": "emt_01krdgeqcxet5s7t44vh8rt9mg",
    "observed_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
    "requested_language": "pt-BR",
    "effective_language": "pt-BR",
    "default_language": "pt-BR"
  },
  "contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg",
  "problems": [
    {
      "code": "parameter_required",
      "phase": "validation",
      "severity": "error",
      "pointer": "/template/parameters/first_name",
      "site": "subject",
      "budget": "output_bytes",
      "contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg"
    }
  ]
}

Changes

No recorded changes to this operation across all 2 revisions of this API.