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

# Restart A/B Test

> Run another sequence A/B test

Start a new draft A/B test for the same sequence node after a winner has been selected. The previous test and metrics stay intact, and the new test becomes active after its generated variants are ready.

## Request

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

<ParamField body="sourceVariantId" type="string">
  Variant ID to use as the new control email. Defaults to the selected winner.
</ParamField>

<ParamField body="testType" type="string">
  Test type: `subject` or `content`. Defaults to `subject`.
</ParamField>

<ParamField body="winnerThreshold" type="number">
  Subscribers before selecting a winner. Must be from 10 to 1000.
</ParamField>

<ParamField body="variantCount" type="number">
  Total variants including the control. Must be from 2 to 4.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123/restart" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sourceVariantId": "var_b", "testType": "content", "variantCount": 3}'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "previousAbTestId": "ab_abc123",
    "sourceVariantId": "var_b",
    "abTest": {
      "id": "ab_new123",
      "status": "draft",
      "variants": [{ "id": "var_new_a", "label": "A" }]
    },
    "nodeConfig": {
      "abTestId": "ab_abc123",
      "winnerId": "var_winner",
      "pendingAbTestId": "ab_new123",
      "pendingExpectedVariantCount": 3
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "A winner must be selected before running another A/B test."
  }
  ```

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

  ```json 404 theme={null}
  {
    "success": false,
    "error": "Selected control email not found"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "error": "Failed to create A/B test"
  }
  ```
</ResponseExample>
