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

# Create Template from Example

> Remix an email gallery example into a new template written for your brand

Remix a public email from the [Sequenzy email gallery](https://sequenzy.com/email-examples) into a new email template for your company. The new email keeps the example's exact layout and design. AI rewrites every piece of text for your company, and Sequenzy swaps in your logo, brand color and website links. The example brand is never named, and none of its copy, offers or claims are reused. Its legal footer is removed; your own compliant footer is added when you send.

The new email is saved as a reusable HTML template (it opens in the HTML editor), the same as **Remix this email** in the dashboard. Review it before you send it.

Generation usually takes 5 to 20 seconds. Nothing is saved when generation fails, so retrying is safe. Every successful call creates another template.

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`.
  A sequence URL returns 400; use [Create Sequence from
  Example](/api-reference/sequences/create-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 for the new email, up to 1000 characters. It takes priority
  over the example, for instance "Announce our mobile app".
</ParamField>

<ParamField body="name" type="string">
  Template name, up to 200 characters. Defaults to the generated subject
  followed by "(remix of {brand})".
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/templates/from-example" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://sequenzy.com/email-examples/brands/linear/emails/welcome-to-linear",
    "brief": "Mention our 14-day free trial"
  }'
```

## Response

<ResponseField name="template" type="object">
  The new template: `id`, `name`, `subject`, `previewText` and `isTemplate`
  (always `true`). Edit it with [Update
  Template](/api-reference/templates/update).
</ResponseField>

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "template": {
      "id": "email_8f2kL9qW",
      "name": "Welcome to Acme (remix of Linear)",
      "subject": "Welcome to Acme",
      "previewText": "Your first project takes two minutes",
      "isTemplate": true
    },
    "example": {
      "brand": "Linear",
      "subject": "Welcome to Linear",
      "url": "https://sequenzy.com/email-examples/brands/linear/emails/welcome-to-linear"
    },
    "message": "Template created with the example's design, rewritten for your brand. Review it before sending."
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Provide either url or brand and email, not both."
  }
  ```

  ```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"
  }
  ```

  ```json 500 theme={null}
  {
    "error": "AI did not generate any email content."
  }
  ```
</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; nothing was saved, so retry. A 422 means a field failed validation, such as a `brief` over 1000 characters.
