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

# Delete A/B Test Variant

> Remove a variant from a draft campaign or sequence A/B test

Remove a variant from a draft campaign or sequence A/B test. Variant A is the control and cannot be deleted, and a test must keep at least 2 variants. Deleting a sequence variant also deletes its dedicated email template; when the parent sequence is active, pass `confirmLiveChange=true` because the deletion immediately changes the live rotation.

## Request

<ParamField path="abTestId" type="string" required>
  A/B test ID.
</ParamField>

<ParamField path="variantId" type="string" required>
  Variant ID to delete.
</ParamField>

<ParamField query="confirmLiveChange" type="boolean">
  Required as `true` when the A/B test belongs to an active sequence.
</ParamField>

```bash theme={null}
curl -X DELETE "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123/variants/var_c" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "abTest": {
      "id": "ab_abc123",
      "campaignId": "camp_abc123",
      "status": "draft",
      "variants": [
        { "id": "var_a", "label": "A", "subject": "A quick update" },
        { "id": "var_b", "label": "B", "subject": "Alternative subject line" }
      ]
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Cannot remove variants after test has started"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Variant A is the control variant and cannot be deleted"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "A/B test must have at least 2 variants"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Deleting a variant from an A/B test in an active sequence requires confirmLiveChange=true"
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized"
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "error": "Variant not found"
  }
  ```
</ResponseExample>
