Videos Qualities

Atualiza as configurações de qualidade e processamento de vídeo de uma library. Use este endpoint para definir quais resoluções estão disponíveis para playback, quais resoluções o pipeline de encod...

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

PUT /library/{library_id}

Atualiza as configurações de qualidade e processamento de vídeo de uma library. Use este endpoint para definir quais resoluções estão disponíveis para playback, quais resoluções o pipeline de encoding deve gerar, se os arquivos originais devem ser preservados e qual o modo de compressão.

📘

Authorization

Requires a valid API token in the Authorization header (without Bearer prefix). The library is resolved by the token's user_id and the library_id in the path must belong to the authenticated user.

⚠️

Important — changes are not retroactive

Quality changes affect only new videos. Already-processed videos keep the qualities they were encoded with. To re-encode an existing video at the new qualities, use the reencode endpoint after updating settings.

HTTP Method & Path

PUT /library/{library_id}

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

Authentication Requirements

HeaderValue
AuthorizationYour Panda API token (no Bearer prefix)

Path Parameters

NameTypeRequiredDescription
library_idstring (uuid v4)yesLibrary ID owned by the authenticated user

Request Body

Content-Type: application/json

All body fields are optional — this is a partial update. Send only the fields you want to change.

Body Parameters

NameTypeConstraintsDescription
playbackstring[]enum 240p 360p 480p 720p 1080p 1440p 2160p; uniqueItems; minItems 1Resolutions made available to the player
encodingstring[]enum (same as playback); uniqueItems; minItems 1Resolutions the transcoding pipeline will generate
keep_original_filesbooleanWhether the original uploaded file is preserved after transcoding
compression_modestringenum size balanced qualityCompression profile (smaller file vs. higher quality)
📘

Business rule (not enforced by the validator)

playback should be a subset of encoding — you can only deliver resolutions that were actually encoded. Configuring a playback value outside of encoding produces unavailable streams. The API does not reject this combination today; the recommendation is operational.

🚧

Do not send block_none_refer here

The Ajv validator is strict (additionalProperties: false) and the request will return 400 must NOT have additional properties: block_none_refer. To toggle the referer policy, use POST /library/{library_id}?action=referValidation.

{
  "playback": ["360p", "480p", "720p", "1080p"],
  "encoding": ["360p", "480p", "720p", "1080p", "1440p"],
  "keep_original_files": true,
  "compression_mode": "balanced"
}

Response

Success Response (200)

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "2481ef9b-5642-4fcd-b9aa-094e98b5cf0a",
  "name": "My Video Library",
  "video_library_id": 12345,
  "pullzone_name": "my-pullzone",
  "pullzone_id": 67890,
  "api_key": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "video_library_pullzone_id": 54321,
  "parallel_upload_limit": 5,
  "playback": ["360p", "480p", "720p", "1080p"],
  "encoding": ["360p", "480p", "720p", "1080p", "1440p"],
  "keep_original_files": true,
  "compression_mode": "balanced",
  "created": "2024-01-15T10:30:00.000Z"
}

Response Schema

FieldTypeDescription
idstring (uuid)Library ID
user_idstring (uuid)Owner user ID
namestringLibrary name
video_library_idintegerBunny CDN video library ID
pullzone_namestringCDN pullzone name
pullzone_idintegerCDN pullzone ID
api_keystringAPI key for the Bunny video library
video_library_pullzone_idintegerVideo library pullzone ID
parallel_upload_limitintegerMax parallel uploads (1–10, default 5)
playbackstring[]Currently configured playback resolutions
encodingstring[]Currently configured encoding resolutions
keep_original_filesbooleanWhether original files are preserved
compression_modestringActive compression profile
createdstring (ISO 8601)Library creation timestamp
drmobjectDRM configuration — only present in the response when configured

Side effects (server-side, not visible in response)

  • encoding is synced to Bunny CDN via the EnabledResolutions setting on the video library.
  • Memcache keys are invalidated: getLibraryById_{library_id}, getVerifyIfHasLibraryId_USER_ID.
  • An audit log entry is queued (via SQS) for each changed attribute under the qualities category (encoding, playback, keep_original_files, compression_mode).

Error Responses

StatusWhen
400Validator rejected the payload — invalid enum value, empty array, unknown property, or malformed library_id
404Library with user id: USER_ID was not found — library does not exist or does not belong to the authenticated user
500Internal error (database, Bunny CDN sync, etc.)

Example 400 (extra property):

{
  "error": "must NOT have additional properties: block_none_refer"
}

Example Usage

cURL — update encoding + playback together

curl -X PUT \
  -H "Authorization: $PANDA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "encoding": ["360p","480p","720p","1080p","1440p"],
    "playback": ["360p","480p","720p","1080p"],
    "compression_mode": "balanced"
  }' \
  https://api-v2.pandavideo.com.br/library/123e4567-e89b-12d3-a456-426614174000

cURL — enable original file preservation only

curl -X PUT \
  -H "Authorization: $PANDA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keep_original_files": true}' \
  https://api-v2.pandavideo.com.br/library/123e4567-e89b-12d3-a456-426614174000

Related

  • Get current settings: GET /library or GET /library/{library_id}
  • Toggle referer policy: POST /library/{library_id}?action=referValidation
  • Manage allowed referrers: POST /library/{library_id}?action=refer
  • Block download (per-library): PUT /block_download
  • Per-video offline configuration: see configure-video-offline
Path Params
uuid
required

Unique identifier of the library

Body Params

Request body for updating library settings. The validator is strict (additionalProperties: false) and accepts only the fields below. To toggle the referer policy use POST /library/{library_id}?action=referValidation.

playback
array of strings

Available playback quality resolutions

playback
Allowed:
encoding
array of strings

Encoding quality resolutions for video conversion

encoding
Allowed:
boolean

Whether to keep original uploaded video files

string
enum

Compression profile (smaller file vs. higher quality)

Allowed:
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