---
title: "Render template HTML"
method: POST
path: "/templates/{templateId}/render"
tags: ["Templates"]
---

# Render template HTML

`POST /templates/{templateId}/render`

Render a template to the exact email-safe HTML that would be sent, for embedding a visual preview. Read-only: this never sends or modifies anything, and uses POST only so personalization input can travel in a request body.

## Path parameters

- `templateId` string, required

## Request body

- RenderEmailRequest — Personalization and output options for a render. Omit every field to render for a sample contact with clean links.
  - `subscriberId` string — Personalize as this stored subscriber. Mutually exclusive with subscriber. The rendered HTML then carries that subscriber's details, so this field additionally requires the subscribers:read scope.
  - `subscriber` object — Personalize as an ad-hoc contact. Mutually exclusive with subscriberId.
    - `email` string, email, required
    - `firstName` string, nullable
    - `lastName` string, nullable
    - `customAttributes` object
  - `variables` object — Extra merge variables layered over the contact's attributes.
  - `locale` string — Force a localization locale instead of deriving it from the contact.
  - `variantId` string — Render a specific A/B test variant. Ignored for templates.
  - `tracking` boolean — Apply the company's auto-UTM link decoration as a real send would. Per-send click redirects and the open pixel need a real email send record and are never present in a render.

## Response `200`

Email rendered successfully

- RenderEmailResponse
  - `success` boolean, required
  - `html` string, required — Email-safe HTML document, rendered exactly as it would be sent.
  - `subject` string, required — Subject line with merge tags resolved.
  - `previewText` string, nullable, required — Inbox preview text with merge tags resolved.
  - `locale` string, required — Localization locale the render resolved to.
  - `personalized` boolean, required — False means no contact was supplied, so a sample contact was used and contact-specific merge tags resolved to empty values.
  - `trackingApplied` boolean, required — Whether auto-UTM link decoration was applied.
  - `unresolvedMergeTags` object[], required — Merge tags that rendered as an empty string. An unrecognized tag and a recognized but blank one are identical in the HTML, so this is the only way to tell them apart. Empty when every tag resolved.
    - `tag` string, required — Tag name as authored, without braces.
    - `reason` 'unknown' | 'no_value', required — unknown - nothing provides this name, so it stays empty for every recipient. no_value - recognized or unverifiable, but blank for this contact. A name is only called unknown when the render had a source to check it against. Without the contact's attributes nothing is checkable, since a bare {{plan}} reads the same attribute map as {{subscriber.plan}}, so pass a stored subscriberId or an inline subscriber with customAttributes. Beyond that, event.* needs sample event properties in variables, recommendedProducts.* needs a stored subscriberId the catalog has something to recommend for, and discount.* is only checkable on a sequence step whose incoming paths all run the same discount step. Rendering a transactional email is checkable only when variables is passed, since its tags come from the variables of each send call and carry no prefix marking them. Otherwise those tags land in no_value rather than in unknown. An optional attribute this contact never had set is kept out of unknown by checking the names other contacts in the account carry, which needs the subscribers:read scope; a key without it may report such a name as unknown.
  - `entity` object, required
    - `type` 'campaign' | 'sequence_step' | 'template', required
    - `id` string, required
    - `variantId` string, nullable, required

## Other responses

- `400` — Validation error
- `401` — Unauthorized
- `403` — API key is missing the required read scope, or is missing subscribers:read while subscriberId was supplied
- `404` — Template not found

---

[API](https://skmtc.net/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.net/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sequenzy/sequenzy-api/versions/af1cf9620482/schema)
