Create new A/B Test

Creates a new A/B test with a name, description, and optional video IDs.

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

POST /comparison

Creates a new A/B test in DRAFT status with the supplied video variants attached.

📘

Authorization

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

HTTP Method & Path

POST /comparison

Base URL: https://api-v2.pandavideo.com.br

Request Body

Content-Type: application/json

Body Parameters

FieldTypeRequiredDescription
namestring (min 1)yesDisplay name for the test.
descriptionstringyesFree‑text description (can be empty string but must be present).
video_idsarray of string (uuid)yesTwo 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 prefix 636f6d70 is 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_ids not unique, video_ids items not matching UUID v4 pattern, or unknown extra properties — additionalProperties: false).
  • 404"Video not found" when any video_ids entry 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"
    ]
  }'

Recipes

Body Params
string
required

Name of the A/B test

string
required

Description of the A/B test

video_ids
array of strings

List of video IDs to include. Accepts empty array.

video_ids
Responses

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