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...
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
PUT /library/{library_id}
{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.
AuthorizationRequires a valid API token in the
Authorizationheader (withoutBearerprefix). The library is resolved by the token'suser_idand thelibrary_idin the path must belong to the authenticated user.
Important — changes are not retroactiveQuality 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
| Header | Value |
|---|---|
Authorization | Your Panda API token (no Bearer prefix) |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
library_id | string (uuid v4) | yes | Library 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
| Name | Type | Constraints | Description |
|---|---|---|---|
playback | string[] | enum 240p 360p 480p 720p 1080p 1440p 2160p; uniqueItems; minItems 1 | Resolutions made available to the player |
encoding | string[] | enum (same as playback); uniqueItems; minItems 1 | Resolutions the transcoding pipeline will generate |
keep_original_files | boolean | — | Whether the original uploaded file is preserved after transcoding |
compression_mode | string | enum size balanced quality | Compression profile (smaller file vs. higher quality) |
Business rule (not enforced by the validator)
playbackshould be a subset ofencoding— you can only deliver resolutions that were actually encoded. Configuring aplaybackvalue outside ofencodingproduces unavailable streams. The API does not reject this combination today; the recommendation is operational.
Do not sendblock_none_referhereThe Ajv validator is strict (
additionalProperties: false) and the request will return400 must NOT have additional properties: block_none_refer. To toggle the referer policy, usePOST /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
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Library ID |
user_id | string (uuid) | Owner user ID |
name | string | Library name |
video_library_id | integer | Bunny CDN video library ID |
pullzone_name | string | CDN pullzone name |
pullzone_id | integer | CDN pullzone ID |
api_key | string | API key for the Bunny video library |
video_library_pullzone_id | integer | Video library pullzone ID |
parallel_upload_limit | integer | Max parallel uploads (1–10, default 5) |
playback | string[] | Currently configured playback resolutions |
encoding | string[] | Currently configured encoding resolutions |
keep_original_files | boolean | Whether original files are preserved |
compression_mode | string | Active compression profile |
created | string (ISO 8601) | Library creation timestamp |
drm | object | DRM configuration — only present in the response when configured |
Side effects (server-side, not visible in response)
encodingis synced to Bunny CDN via theEnabledResolutionssetting 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
qualitiescategory (encoding, playback, keep_original_files, compression_mode).
Error Responses
| Status | When |
|---|---|
400 | Validator rejected the payload — invalid enum value, empty array, unknown property, or malformed library_id |
404 | Library with user id: USER_ID was not found — library does not exist or does not belong to the authenticated user |
500 | Internal 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-426614174000cURL — 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-426614174000Related
- Get current settings:
GET /libraryorGET /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
