---
title: "End an audience A/B test"
method: POST
path: "/{teamPid}/campaigns/{campaign}/audiences/{audience}/test/end"
tags: ["Campaigns"]
---

# End an audience A/B test

`POST /{teamPid}/campaigns/{campaign}/audiences/{audience}/test/end`

## Request

- Base URL: `https://api.rightmessage.com/v1`
- URL: `https://api.rightmessage.com/v1/{teamPid}/campaigns/{campaign}/audiences/{audience}/test/end`
- Auth: HTTP bearer

Ends the audience's test in the draft and keeps the chosen version. For the Original page test, `deploy` shows the kept version to everyone. Takes effect after you publish.

Requires an API token with the `write` ability. Tokens created without abilities have `*`, which grants every ability.

## Path parameters

- `teamPid` string, required
- `campaign` string, required
- `audience` string, required

## Request body

- object
  - `keep_version` 'A' | 'B' | 'C' | 'D', required
  - `deploy` boolean

## Response `200`

- object
  - `campaign` object, nullable, required
  - `requires_publish` boolean, required

## Other responses

- `401`: Missing, invalid or revoked API token.
- `404`: Not found
- `422`: Validation error
- `429`: Rate limit exceeded: 120 requests per minute for project endpoints, 60 per minute for token and connection endpoints. Retry after the `Retry-After` seconds.

---

[API](https://skmtc.dev/rightmessage/apis/rightmessage-api.md) - [All operations](https://skmtc.dev/rightmessage/apis/rightmessage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rightmessage/apis/rightmessage-api/revisions/adec35e9720c?raw)
