> ## 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 Section Options

> Generate alternative versions of selected sections of an email or variation

Generates 1 to 4 alternative versions of selected sections (top-level blocks) of the email or of one variation. Nothing is saved: each option holds replacement blocks that keep the selected blocks' ids. To apply an option, swap those blocks into the variation's `blocks` by id and call [Update Variation](/api-reference/campaigns/variations-update).

Changes the AI makes outside the selected sections are dropped, and options that change nothing are left out, so you can get fewer options than `count`. If none change anything, you get a `400` with the AI's explanation. Emails that are a single raw HTML block can't be varied by section. The request runs synchronously and can take up to a minute; a `500` means generation failed and can be retried.

## Request

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

<ParamField body="sectionIds" type="string[]" required>
  Ids of top-level blocks to vary, 1 to 50.
</ParamField>

<ParamField body="prompt" type="string" required>
  What should change, in any language. Up to 2,000 characters.
</ParamField>

<ParamField body="variationId" type="string">
  Vary this variation's sections. It must be `ready`. Omit to vary the email's
  saved content.
</ParamField>

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

<ParamField body="style" type="string">
  How far the options move from the selected sections: `close` keeps its style and
  structure, `fresh` takes clearly different directions, and `bold` designs each
  option anew with its own layout, colors and fonts (a theme of its own).
  Defaults to `fresh`.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/campaigns/camp_abc123/variations/section-options" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "variationId": "var_9xk2", "sectionIds": ["h1"], "prompt": "Punchier headline" }'
```

## Response

<ResponseField name="options" type="array">
  <Expandable title="option">
    <ResponseField name="name" type="string">
      Short name for the option.
    </ResponseField>

    <ResponseField name="summary" type="string">
      What changed.
    </ResponseField>

    <ResponseField name="replacements" type="array">
      New versions of the selected blocks, with the same ids.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "options": [
      {
        "name": "Shorter headline",
        "summary": "Cut the headline to five words.",
        "replacements": [
          { "id": "h1", "type": "heading", "content": "Pricing, simplified", "level": 1 }
        ]
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": "These sectionIds are not top-level blocks of the variation: h9"
  }
  ```

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

  ```json 500 theme={null}
  {
    "error": "Couldn't make options for these sections. Try again."
  }
  ```
</ResponseExample>


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