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

# Select A/B Test Winner

> Select a campaign winner and deliver it to the remaining audience

Select a variant as the winner of a campaign A/B test currently in the
`testing` phase. Selection immediately queues winner delivery for the remaining
audience. Repeating the same selection safely repairs an interrupted queue
operation; selecting a different winner returns a conflict.

## Request

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

<ParamField body="variantId" type="string" required>
  Variant ID to select as the winner.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123/select-winner" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"variantId":"var_b"}'
```

The API key must have both `ab_tests:write` and `campaigns:send` scopes.

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "abTest": {
      "id": "ab_abc123",
      "status": "winner_selected",
      "winningVariantId": "var_b"
    }
  }
  ```

  ```json 409 theme={null}
  {
    "success": false,
    "error": "Another winner was selected at the same time"
  }
  ```
</ResponseExample>
