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

> Clone an email gallery sequence into a draft sequence written for your brand

Clone a public sequence from the [Sequenzy email gallery](https://sequenzy.com/email-examples/sequences) into a draft sequence for your company, the same as **Clone this sequence** in the dashboard.

The draft keeps the example's trigger family and send timing, up to 12 emails. AI then writes every email in your brand in the background, usually within 30 to 60 seconds. Poll [Get Sequence](/api-reference/sequences/get) until `enrichmentStatus` is `complete`; it reports `pending` until the first email is written, then `in_progress`. The sequence sends nothing until you [enable it](/api-reference/sequences/enable).

Every successful call creates another sequence, so do not retry after a success. Requires the `sequences:write` scope.

## Triggers and timing

| Example sequence | Starts when | Stops early |
| - | - | - |
| Onboarding | A contact is added (`contact_added`) | No |
| Abandoned cart | `ecommerce.cart_abandoned` is received | On `ecommerce.order_placed` |
| Post-purchase | `ecommerce.order_placed` is received | No |
| Re-engagement | The `inactive` tag is added | When the tag is removed |

Waits follow the real gaps between the example's emails: gaps under a day stay in hours, with at least one hour between emails, and longer gaps round to whole days. Onboarding waits for the day the first email arrived after signup. The other types start at their trigger: cart recovery waits one hour before its first email, and post-purchase and re-engagement send their first email right away. You can change the trigger and waits in the builder before enabling.

## 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.
</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 applied to every email, up to 1000 characters. It takes
  priority over the example.
</ParamField>

<ParamField body="name" type="string">
  Sequence name, up to 200 characters. Defaults to the sequence type, such as
  "Onboarding sequence".
</ParamField>

<ParamField body="emailStyle" type="string">
  `visual` or `plain`. Defaults to your company's email style preference.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/sequences/from-example" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brand": "linear",
    "sequence": "onboarding",
    "brief": "Push new users to invite a teammate"
  }'
```

## Response

<ResponseField name="sequence" type="object">
  The draft: `id`, `name`, `status` (`draft`), `trigger`, `triggerDescription`,
  `eventName` or `tagName` when the trigger uses one, `stopCondition` (the exit
  rule the sequence was created with, when it has one), `emailCount`,
  `enrichmentStatus` (`processing`, or `not_queued` when writing could not
  start) and `steps`. Each step has `stepNumber`, `title`, `delayMs` (the wait
  before it) and `originalDay`.
</ResponseField>

<ResponseField name="example" type="object">
  The gallery sequence: `brand`, `name`, `url` and `omittedEmailCount`, the
  number of emails beyond the 12-step limit that were not cloned.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "sequence": {
      "id": "seq_3kLm9",
      "name": "Onboarding sequence",
      "status": "draft",
      "trigger": "trigger_list",
      "triggerDescription": "When someone signs up",
      "emailCount": 2,
      "enrichmentStatus": "processing",
      "steps": [
        { "stepNumber": 1, "title": "Welcome", "delayMs": 0, "originalDay": 0 },
        { "stepNumber": 2, "title": "Feature tip", "delayMs": 259200000, "originalDay": 3 }
      ]
    },
    "example": {
      "brand": "Linear",
      "name": "Linear onboarding",
      "url": "https://sequenzy.com/email-examples/brands/linear/sequences/onboarding",
      "omittedEmailCount": 0
    },
    "message": "Draft sequence created with the example's trigger and timing. AI is writing each email in your brand; this typically takes 30-60 seconds. It stays a draft until you activate it."
  }
  ```

  ```json 400 theme={null}
  {
    "error": "That url is an email example. Remix single emails with the template endpoint, or pass a sequence page url."
  }
  ```

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

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

  ```json 500 theme={null}
  {
    "error": "Failed to remix the example"
  }
  ```
</ResponseExample>

A 404 with code `EMAIL_GALLERY_UNAVAILABLE` means the email gallery is not available yet. A 422 means a field failed validation, such as a `brief` over 1000 characters or an unknown `emailStyle`.

If the draft is created but writing its emails cannot start, the response still succeeds, with `enrichmentStatus: "not_queued"` and a `warnings` entry. Open the sequence in the dashboard to write the emails instead of calling this endpoint again, which would create a second sequence.
