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

# Preview Template from Example

> See an email gallery example written for your brand without saving it

Rewrite a public email from the [Sequenzy email gallery](https://sequenzy.com/email-examples) and get it back without saving anything. It is the same rewrite as [Create Template from Example](/api-reference/templates/create-from-example): the example's layout and design, every word written for your brand, and your logo, brand color and links swapped in.

By default the preview is written for your company's brand profile. Pass `website` to write it for another site instead, such as a prospect or a client. The site is looked up like the public gallery's **See it for your brand** preview.

Generation usually takes 5 to 20 seconds. Each call writes a new version. To keep one, call Create Template from Example; it writes the email again for your own brand.

Requires the `templates:write` scope.

## Request

Identify the example with `url`, or with `brand` and `email`. Sending both returns 400.

<ParamField body="url" type="string">
  Gallery email page URL, such as
  `https://sequenzy.com/email-examples/brands/linear/emails/welcome-to-linear`,
  or a sequence page URL ending in `#email-{email}` for an email in a sequence.
  A sequence URL without an email returns 400; use [Preview Sequence from
  Example](/api-reference/sequences/preview-from-example) for sequences.
</ParamField>

<ParamField body="brand" type="string">
  Gallery brand slug, from `/email-examples/brands/{brand}/...`. Use with
  `email`.
</ParamField>

<ParamField body="email" type="string">
  Gallery email slug, from `/emails/{email}`. Use with `brand`.
</ParamField>

<ParamField body="brief" type="string">
  Optional direction, up to 1000 characters. It takes priority over the example.
</ParamField>

<ParamField body="website" type="string">
  Optional site or domain, such as `acme.com`, to write the preview for instead
  of your own brand. Its registrable domain is used, so
  `https://www.acme.com/pricing` becomes `acme.com`. A value that is not a site
  returns 400.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/templates/from-example/preview" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brand": "linear",
    "email": "welcome-to-linear",
    "website": "acme.com"
  }'
```

## Response

<ResponseField name="preview" type="object">
  The unsaved rewrite: `brandName` (whose brand it is written in), `website`
  (the normalized `website`, or `null` for your own brand), `subject`,
  `previewText` and `html`.
</ResponseField>

<ResponseField name="example" type="object">
  The gallery example it is modeled on: `brand`, `subject` and `url`.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "preview": {
      "brandName": "Acme",
      "website": "acme.com",
      "subject": "Welcome to Acme",
      "previewText": "Your first project takes two minutes",
      "html": "<html>...</html>"
    },
    "example": {
      "brand": "Linear",
      "subject": "Welcome to Linear",
      "url": "https://sequenzy.com/email-examples/brands/linear/emails/welcome-to-linear"
    },
    "message": "Preview only: nothing was saved. Call POST /templates/from-example to save a template."
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Pass website as a site or domain, like acme.com."
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Invalid API key"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "That gallery email was not found. It may have been removed.",
    "code": "EXAMPLE_NOT_FOUND"
  }
  ```
</ResponseExample>

A 404 with code `EMAIL_GALLERY_UNAVAILABLE` means the email gallery is not available yet. A 503 with code `REMIX_FAILED` means the rewrite came back incomplete; retry. A 422 means a field failed validation, such as a `brief` over 1000 characters.


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