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

# Generate Campaign Variations

> Generate alternative versions of a campaign email with AI

Starts generating 1 to 4 variations with AI and returns them at once with `status: "generating"`. Each one takes its own direction, planned from your prompt, so the versions differ from each other. `style` sets how far they move: `close` versions are edits of the source; `fresh` versions are written anew from its content, each with its own structure in your brand's colors and fonts; `bold` versions also get their own look (a theme of their own). The campaign email does not change.

Generation runs in the background and usually takes under a minute. Poll [List Variations](/api-reference/campaigns/variations-list) or [Get Variation](/api-reference/campaigns/variations-get) until each one is `ready` or `failed`. Each variation succeeds or fails on its own; a failed one has an `error` and no blocks. A variation still generating after 10 minutes is reported as `failed`. Retrying is a new request: it creates new variations rather than resuming failed ones.

The source is the email's saved content, or the variation in `parentVariationId`, which must be `ready`. An email that is a single raw HTML block can't be varied: convert it to Sequenzy blocks first (the editor hides its Canvas tab for HTML emails too). To make the new versions stay close to a version you liked, pass it as `parentVariationId` (they default to `style: "close"`); pass `style: "bold"` for something completely different.

## Request

<ParamField path="campaignId" type="string" required>
  Campaign ID. Email campaigns only.
</ParamField>

<ParamField body="prompt" type="string" required>
  The direction for the new versions, in any language. Up to 2,000 characters.
  Name specific versions ("one formal, one playful") to get exactly those.
</ParamField>

<ParamField body="count" type="integer" default="3">
  How many variations to generate, from 1 to 4.
</ParamField>

<ParamField body="parentVariationId" type="string | null">
  Derive from this variation instead of the email. The new variations are its
  branches.
</ParamField>

<ParamField body="style" type="string">
  How far the new versions move from the source: `close` edits it, keeping its
  style and structure; `fresh` writes each version anew with its own structure
  in your brand's colors and fonts; `bold` also gives each its own look (a theme
  of its own).
  Defaults to `close` for branches of a variation and `fresh` otherwise.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/campaigns/camp_abc123/variations/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Three versions that are shorter and warmer", "count": 3 }'
```

## Response

Returns `202 Accepted`.

<ResponseField name="variations" type="array">
  The new variations, all with `status: "generating"` and `blocks: null`.
</ResponseField>

<ResponseExample>
  ```json 202 theme={null}
  {
    "success": true,
    "variations": [
      {
        "id": "var_9xk2",
        "emailId": "email_abc123",
        "parentId": null,
        "label": "V3",
        "name": "New variation",
        "summary": null,
        "prompt": "Three versions that are shorter and warmer",
        "style": "fresh",
        "status": "generating",
        "error": null,
        "subject": null,
        "previewText": null,
        "blocks": null,
        "emailTheme": null,
        "fontFamily": null,
        "position": null,
        "inUse": false,
        "usedAt": null,
        "createdAt": "2026-10-14T09:12:00.000Z",
        "updatedAt": "2026-10-14T09:12:00.000Z"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": "This is an SMS campaign. SMS campaigns are managed from the dashboard; this endpoint only supports email campaigns."
  }
  ```

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

  ```json 404 theme={null}
  {
    "error": "Variation not found"
  }
  ```

  ```json 409 theme={null}
  {
    "error": "This variation has no content to build on yet"
  }
  ```

  ```json 503 theme={null}
  {
    "error": "Could not start generating variations. Try again."
  }
  ```
</ResponseExample>

When the email is empty, each variation is a complete first draft, ending with your company's default footer if you have one. Variations change content (blocks, subject and preview text), not the email's theme.

A `409` also means the email already has variations generating and this request would take it past 8 at once. Wait for some to finish (poll [List variations](./variations-list)), then send the request again.

A `503` means generation could not be started. Any variations it created are marked `failed`; send the request again.


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