> ## 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 Sequence from Example

> See the first emails of an email gallery sequence written for your brand

Rewrite the first 3 emails of a public sequence from the [Sequenzy email gallery](https://sequenzy.com/email-examples) and get them back without creating anything. Each email keeps the example's layout with every word written for your brand.

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 emails are written in parallel. Any that could not be written this time are counted in `failedEmailCount`; the call fails only when none could be written. It usually takes 10 to 30 seconds. To create the sequence, call [Create Sequence from Example](/api-reference/sequences/create-from-example), which writes every email again for your own brand.

Requires the `sequences:write` scope.

## Request

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

<ParamField body="url" type="string">
  Gallery sequence page URL, such as
  `https://sequenzy.com/email-examples/brands/linear/sequences/onboarding`. An
  email URL returns 400; use [Preview Template from
  Example](/api-reference/templates/preview-from-example) for one email.
</ParamField>

<ParamField body="brand" type="string">
  Gallery brand slug. Use with `sequence`.
</ParamField>

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

<ParamField body="brief" type="string">
  Optional direction for every email, 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. A value that is not a site
  returns 400.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/sequences/from-example/preview" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://sequenzy.com/email-examples/brands/linear/sequences/onboarding"
  }'
```

## Response

<ResponseField name="preview" type="object">
  The unsaved rewrite: `brandName`, `website` (`null` for your own brand),
  `emails`, `remainingEmailCount` (emails in the example beyond the preview) and
  `failedEmailCount` (previewed emails that could not be written this time).
  Each email has `stepNumber` (its position in the example, from 1), `day`,
  `originalSubject`, `subject`, `previewText` and `html`.
</ResponseField>

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "preview": {
      "brandName": "Acme",
      "website": null,
      "emails": [
        {
          "stepNumber": 1,
          "day": 0,
          "originalSubject": "Welcome to Linear",
          "subject": "Welcome to Acme",
          "previewText": "Your first project takes two minutes",
          "html": "<html>...</html>"
        }
      ],
      "remainingEmailCount": 2,
      "failedEmailCount": 0
    },
    "example": {
      "brand": "Linear",
      "name": "Linear onboarding",
      "emailCount": 5,
      "url": "https://sequenzy.com/email-examples/brands/linear/sequences/onboarding"
    },
    "message": "Preview only: the first emails, nothing saved. Call POST /sequences/from-example to create the draft sequence."
  }
  ```

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

  ```json 503 theme={null}
  {
    "error": "The preview could not be written. Try again in a moment.",
    "code": "REMIX_FAILED"
  }
  ```
</ResponseExample>

A 400 means a missing, conflicting or invalid example reference, or a malformed `website`. A 404 with code `EMAIL_GALLERY_UNAVAILABLE` means the email gallery is not available yet. A 422 means a field failed validation.


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