> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Render Blocks Preview HTML

> Render unsaved email blocks or HTML to email-ready HTML without creating or updating a template

Render Sequenzy email block JSON (or raw HTML) straight to the exact email-safe HTML that Sequenzy sends, without creating or updating a template in your account. Use this when your own admin UI or editor holds draft blocks locally and needs a live visual preview.

The render applies your company's branding, logo, footer, email theme, and font by default, and supports optional overrides (`emailTheme`, `fontFamily`, `emailDirection`, `isTransactional`), merge tags, block visibility conditions, and product recommendation blocks.

> [!NOTE]
>
> This endpoint is read-only. It requires the `templates:read` scope and never
> saves or sends anything. Passing `subscriberId` also requires the
> `subscribers:read` scope.

## Request

Provide either `blocks` or `html`, not both.

**blocks** `object[]`

Sequenzy email block JSON array to render (the same structure returned by [Get
Template](https://docs.sequenzy.com/api-reference/templates/get.md) and accepted by [Create
Template](https://docs.sequenzy.com/api-reference/templates/create.md)). Mutually exclusive with `html`.

**html** `string`

Raw HTML email document to render. Mutually exclusive with `blocks`.

**subject** `string`

Optional subject line. Merge tags are resolved and returned in `subject`.
Defaults to an empty string.

**previewText** `string | null`

Optional inbox preview text (preheader). Merge tags are resolved and returned
in `previewText`.

**emailTheme** `object | null`

Optional full or partial `emailTheme` override (accepts the object returned by
`GET /api/v1/templates/{templateId}` as-is, or a partial patch). Omit or pass
`null` to use your company's email theme.

**fontFamily** `string | null`

Optional font family override (1 to 500 characters). Omit or pass `null` to
use your company's font family.

**emailDirection** `string | null`

Optional text direction: `ltr` or `rtl`. Omit or pass `null` to use your
company's direction.

**isTransactional** `boolean` (default: false)

When `true`, omits the unsubscribe footer and treats `variables` as
transactional sender variables, matching transactional email sends.

**subscriberId** `string`

Personalize as this stored subscriber. Use this or `subscriber`, not both.
Requires the `subscribers:read` scope.

**subscriber** `object`

Personalize as an ad-hoc contact that does not need to exist in your account.
Accepts `email` (required), `firstName`, `lastName`, `customAttributes`, and
`tags`. Use this or `subscriberId`, not both.

**variables** `object`

Extra merge variables layered over the contact's attributes.

**locale** `string`

Locale code for date/number formatting and company footer localization.
Defaults to your company's language or `en`.

**tracking** `boolean` (default: false)

Apply your company's auto-UTM link decoration, as a real send would. Defaults
to `false` so the preview shows your own clean URLs.

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/templates/render" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "{{EVENTNAME}} is live!",
    "blocks": [
      { "id": "l-logo", "type": "logo", "alt": "Acme", "align": "center", "width": 100 },
      { "id": "l-h", "type": "heading", "level": 1, "content": "Your event is live!" },
      { "id": "l-hi", "type": "text", "variant": "paragraph", "content": "Hi {{RECIPIENTNAME|there}}, <b>{{EVENTNAME}}</b> is now live." },
      { "id": "l-btn", "type": "button", "variant": "primary", "text": "Your event link", "url": "{{EVENTLINK}}" }
    ],
    "variables": {
      "RECIPIENTNAME": "Alex",
      "EVENTNAME": "Summer Fest",
      "EVENTLINK": "https://example.com/events/summer-fest"
    }
  }'
```

## Merge tags, conditions, and warnings

* `unresolvedMergeTags` and `unevaluatedConditions` work the same way as [Render Template HTML](https://docs.sequenzy.com/api-reference/templates/render.md).
* When `blocks` contains unknown or ignored fields, or repeated block runs, non-fatal messages are returned in `warnings`.
* Per-send click redirects, the open tracking pixel, and unsubscribe click tracking are applied at send time against a real email send record and are never present in the preview HTML.

## Responses

```json 200 theme={null}
{
  "success": true,
  "html": "<!DOCTYPE html><html>...</html>",
  "subject": "Summer Fest is live!",
  "previewText": null,
  "locale": "en",
  "personalized": false,
  "trackingApplied": false,
  "unresolvedMergeTags": [],
  "unevaluatedConditions": [],
  "entity": {
    "type": "inline",
    "id": null,
    "variantId": null
  }
}
```

```json 400 theme={null}
{
  "error": "Provide either blocks or html."
}
```

```json 401 theme={null}
{
  "error": "Unauthorized"
}
```

```json 403 theme={null}
{
  "error": "API key is missing required scope: subscribers:read"
}
```

```json 404 theme={null}
{
  "error": "Subscriber not found"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.