Compare video variants, monitor variant-level analytics, and declare a winner — all via the API.
A/B Testing lets you compare different video variants to identify which one performs best with your audience. Create a test, attach two or more videos, start the test, monitor variant-level analytics (plays rate and retention), and finally declare a winner — all programmatically via the API.
AuthorizationEvery endpoint in this folder requires an API Key in the
Authorizationheader. Send the key directly — noBearerprefix.
How A/B Tests work
- An A/B test (also called a comparison) is a container that groups two or more video variants for performance comparison.
- Each test goes through a defined lifecycle of states.
- While a test is running, traffic is split across the attached video variants.
- Analytics for each variant are tracked separately — plays rate and retention can be retrieved per variant.
- When the test ends, a winner is declared (manually) and the test is marked as completed.
Lifecycle & states
| Status | Value | Meaning | Transitions to |
|---|---|---|---|
| Draft | DRAFT | Created but not yet started | IN_PROGRESS (via Start) |
| In Progress | IN_PROGRESS | Test is running and collecting data | COMPLETED (via End) |
| Completed | COMPLETED | Test ended, winner declared | None (terminal) |
Update behavior depends on status. While the test isDRAFTyou can change everything (name, description, variants). Once started or completed, onlynameanddescriptionare persisted —video_idsis silently ignored by the server. See Update A/B Test.
Identifying A/B tests
- A/B test IDs always start with the prefix
636f6d70-(hex of "comp"), making them easy to spot in mixed‑resource responses. - All A/B test management endpoints share the base path
/comparisononhttps://api-v2.pandavideo.com.br. - Variant analytics endpoints live on a separate host:
https://data.pandavideo.com.
Endpoints
| Endpoint | Operation |
|---|---|
| List of A/B Tests | GET /comparison |
| Get A/B Tests Properties | GET /comparison/{id} |
| Create new A/B Test | POST /comparison |
| Start A/B Test | PUT /comparison/{id}?type=start |
| Update A/B Test | PUT /comparison/{id}?type=update |
| End A/B Test | PUT /comparison/{id}?type=finish |
| Delete A/B Tests | DELETE /comparison |
| A/B Test Plays Rate | GET /general/{video_id} (analytics host) |
| A/B Test Retention | GET /retention/{video_id} (analytics host) |
?type=is required on every PUT. The gateway dispatchesPUT /comparison/{id}by the query parametertype(start|update|finish). Calls without?type=...return400 "Type not specified".
Response envelope
All management endpoints that return a comparison enrich the body with the user's CDN pullzone, useful when building player URLs client‑side:
{
"id": "636f6d70-…",
"name": "Thumb test",
"videos": [ … ],
"pullzone": "myzone"
}The list endpoint wraps it as { "comparisons": [ … ], "pullzone": "myzone" }.
