post
https://api-v2.pandavideo.com.br/comparison
Creates a new A/B test with a name, description, and optional video IDs.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
POST /comparison
Creates a new A/B test in DRAFT status with the supplied video variants attached.
AuthorizationRequires a valid API Key in the
Authorizationheader. Send the key directly — noBearerprefix.
HTTP Method & Path
POST /comparison
Base URL: https://api-v2.pandavideo.com.br
Request Body
Content-Type: application/json
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string (min 1) | yes | Display name for the test. |
description | string | yes | Free‑text description (can be empty string but must be present). |
video_ids | array of string (uuid) | yes | Two or more video identifiers to attach as variants. Items must be unique, must match the v4 UUID pattern, and all videos must belong to the authenticated user (otherwise 404 "Video not found"). |
{
"name": "Thumb test — Q1",
"description": "Comparing 2 thumbnails for the welcome video.",
"video_ids": [
"f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d6",
"f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d7"
]
}Response
Success Response (200)
Returns the freshly created comparison (status DRAFT) with its variants already attached, plus the user's pullzone.
{
"id": "636f6d70-e29b-41d4-a716-446655440000",
"name": "Thumb test — Q1",
"description": "Comparing 2 thumbnails for the welcome video.",
"status": "DRAFT",
"videos": [ /* same shape as Get A/B Tests Properties */ ],
"pullzone": "myzone"
}
ID format. Comparison IDs are deterministic: the prefix636f6d70is the hex of"comp"followed by 28 chars of a UUID v4. You can rely on the prefix to identify A/B tests in mixed responses.
Side effects
- A per‑comparison config JSON is written to S3 under the user's pullzone (
{ status, videos[].video_external_id }). This is what the player reads to split traffic. - An audit log is queued (
category: comparison, activity: create).
Error Responses
- 400 — body fails the AJV schema (missing
name/description/video_ids,video_idsnot unique,video_idsitems not matching UUID v4 pattern, or unknown extra properties —additionalProperties: false). - 404 —
"Video not found"when anyvideo_idsentry does not belong to the user. - 401 — missing/invalid API Key.
- 500 —
"Library not found"or any internal error.
Example Usage
cURL
curl --request POST \
--url 'https://api-v2.pandavideo.com.br/comparison' \
--header 'Authorization: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Thumb test — Q1",
"description": "Comparing 2 thumbnails for the welcome video.",
"video_ids": [
"f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d6",
"f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d7"
]
}'