End A/B Test

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

PUT /comparison/{id}?type=finish

Ends an A/B test and declares a winner. Sets status to COMPLETED and stamps ended_at server‑side.

📘

Authorization

Requires a valid API Key in the Authorization header. Send the key directly — no Bearer prefix.

🚧

?type=finish is required

Missing or wrong type returns 400 "Type not specified".

⚠️

Winner not validated against the test's variants

The server checks winner_video_id belongs to the user, not specifically to the comparison's variants. Send only a video_id that 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

NameTypeRequiredDescription
idstringyesComparison id (starts with 636f6d70-).

Query Parameters

NameTypeRequiredDescription
typestringyesMust be finish.

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
winner_video_idstring (uuid v4)yesIdentifier 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 of video_external_ids and winner_video_id set 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" }'

Recipes

Path Params
uuid
required

Unique ID of the A/B test (prefix 636f6d70-)

Query Params
string
required
Defaults to finish

Operation type. Must be "finish".

Body Params
uuid
required

ID of the video declared as the winner of the test

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json