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

> Delete a campaign A/B test

Delete a campaign A/B test and all of its variants. Running tests (`testing` or `winner_selected`) cannot be deleted, and the linked campaign must be in `draft` or `rejected` status. This action cannot be undone.

## Request

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

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

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Cannot delete a running A/B test"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Only campaign A/B tests are supported by this endpoint."
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Campaign structure can only be changed in draft or rejected status."
  }
  ```

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

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