A/B Testing

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.

📘

Authorization

Every endpoint in this folder requires an API Key in the Authorization header. Send the key directly — no Bearer prefix.

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

StatusValueMeaningTransitions to
DraftDRAFTCreated but not yet startedIN_PROGRESS (via Start)
In ProgressIN_PROGRESSTest is running and collecting dataCOMPLETED (via End)
CompletedCOMPLETEDTest ended, winner declaredNone (terminal)
⚠️

Update behavior depends on status. While the test is DRAFT you can change everything (name, description, variants). Once started or completed, only name and description are persisted — video_ids is 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 /comparison on https://api-v2.pandavideo.com.br.
  • Variant analytics endpoints live on a separate host: https://data.pandavideo.com.

Endpoints

EndpointOperation
List of A/B TestsGET /comparison
Get A/B Tests PropertiesGET /comparison/{id}
Create new A/B TestPOST /comparison
Start A/B TestPUT /comparison/{id}?type=start
Update A/B TestPUT /comparison/{id}?type=update
End A/B TestPUT /comparison/{id}?type=finish
Delete A/B TestsDELETE /comparison
A/B Test Plays RateGET /general/{video_id} (analytics host)
A/B Test RetentionGET /retention/{video_id} (analytics host)
🚧

?type= is required on every PUT. The gateway dispatches PUT /comparison/{id} by the query parameter type (start | update | finish). Calls without ?type=... return 400 "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" }.