Add videos to playlist

Adds one or more videos to a playlist

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

POST /playlists/{playlist_id}/videos

Adds one or more videos to a playlist. Order is either explicit per item or auto‑incremented by the server.

📘

Authorization

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

⚠️

videos[] is an array of objects (not strings)

The body is a JSON array at the top level — each item is { video_id, order? }. Unlike Funnel's remove_videos (plain string array), Playlist endpoints always carry the wrapped object shape.

🚧

Hard cap: 500 videos per playlist

Server‑side guard: existing_count + new_videos > 500 returns 400 "Playlist cannot have more than 500 videos".

HTTP Method & Path

POST /playlists/{playlist_id}/videos

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

Path Parameters

NameTypeRequiredDescription
playlist_idstring (uuid)yesPlaylist identifier.

Request Body

Content-Type: application/json — a top‑level array.

Item shape

FieldTypeRequiredDescription
video_idstring (uuid)yesVideo to add. Must belong to the authenticated user (cross‑user IDs return 400 "Videos not found: …").
orderinteger ≥ 0noPosition. If omitted, the server uses max(order in batch) + 1.
playlist_idstring (uuid)noOptional echo of the playlist id; the path is authoritative. The dashboard always sends it for symmetry.
[
  { "video_id": "f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d6", "order": 0, "playlist_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" },
  { "video_id": "f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d7", "order": 1, "playlist_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
]
📘

Re‑adding a video updates its order. The bulk insert runs with updateOnDuplicate: ['order']. So sending an existing (playlist_id, video_id) pair simply updates the order. This is also how the dashboard implements reorder — it re‑POSTs the full list.

Response

Success Response (200)

Returns the array of inserted/updated records.

[
  { "playlist_id": "a1b2c3d4-...", "video_id": "f1f2f3f4-...d5d6", "order": 0 },
  { "playlist_id": "a1b2c3d4-...", "video_id": "f1f2f3f4-...d5d7", "order": 1 }
]

Side effects

  • Playlist duration and videos_quantity are recomputed server‑side from playlist_videos + video.metadata.length.
  • Memcache key playlist_details_{playlist_id} is invalidated.

Error Responses

  • 400"Videos must be an array", "No videos provided", "Each video must have a video_id", "Video order must be a number", "Videos not found: …", or "Playlist cannot have more than 500 videos".
  • 401 — missing/invalid API Key.
  • 500 — ownership rejected or internal error.

Example Usage

cURL

curl --request POST \
  --url 'https://api-v2.pandavideo.com.br/playlists/a1b2c3d4-e5f6-7890-abcd-ef1234567890/videos' \
  --header 'Authorization: <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data '[
    { "video_id": "f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d6", "order": 0 }
  ]'

Recipes

Path Params
uuid
required

Unique identifier of the playlist

Body Params
Responses

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