Declare a winner and end an A/B test. Sets the winner_video_id, fills ended_at, and changes the test status to COMPLETED. This action is irreversible.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
PUT /comparison/{id}?type=finish
{id}?type=finishEnds an A/B test and declares a winner. Sets status to COMPLETED and stamps ended_at server‑side.
AuthorizationRequires a valid API Key in the
Authorizationheader. Send the key directly — noBearerprefix.
?type=finishis requiredMissing or wrong
typereturns400 "Type not specified".
Winner not validated against the test's variantsThe server checks
winner_video_idbelongs to the user, not specifically to the comparison's variants. Send only avideo_idthat is actually attached to the test, otherwise the winner stamp will reference a video outside the experiment.
HTTP Method & Path
PUT /comparison/{id}?type=finish
Base URL: https://api-v2.pandavideo.com.br
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | Comparison id (starts with 636f6d70-). |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | yes | Must be finish. |
Request Body
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
winner_video_id | string (uuid v4) | yes | Identifier of the winning variant. Must be one of the videos attached to the test (not server‑enforced — see warning above). |
{ "winner_video_id": "f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d7" }Response
Success Response (200)
{
"id": "636f6d70-e29b-41d4-a716-446655440000",
"name": "Thumb test — Q1",
"status": "COMPLETED",
"winner_video_id": "f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d7",
"ended_at": "2025-01-22T10:00:00.000Z",
"videos": [ /* same shape as Get A/B Tests Properties */ ],
"pullzone": "myzone"
}Side effects
- The S3 config for the comparison is rewritten with
status: "COMPLETED", the full list ofvideo_external_ids andwinner_video_idset to the winner's external id (not the internal UUID). The player uses this to route traffic to the winning variant going forward. - An audit log is queued (
category: comparison, activity: winner).
Error Responses
- 400 — body fails the AJV schema (missing
winner_video_id, wrong UUID pattern, or extra properties). Also"Type not specified"if the query is missing. - 404 — the winner video does not belong to the user.
- 401 — missing/invalid API Key.
- 500 —
"Library not found", comparison not found, or internal error.
Example Usage
cURL
curl --request PUT \
--url 'https://api-v2.pandavideo.com.br/comparison/636f6d70-e29b-41d4-a716-446655440000?type=finish' \
--header 'Authorization: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{ "winner_video_id": "f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d7" }'