Updates the HLS segment duration of a specific library. Send only the hls_segment_duration field in the body; the library_id goes in the URL.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
PUT /library/{library_id}
{library_id}Updates the HLS segment duration of a specific library. Send only the hls_segment_duration field in the body; the library_id goes in the URL.
The HLS segment duration is how long each .ts piece of a transcoded video lasts (default 6 seconds). A larger segment produces fewer files, and therefore fewer requests to the CDN and to storage — a cost lever (4s → 6s is about 33% fewer files per video). It does not reduce bandwidth in GB (the bitrate is the same), and it can slightly increase time-to-first-frame and reduce seek precision.
AuthorizationRequires a valid API token in the
Authorizationheader (noBearerprefix).
HTTP Method & Path
PUT /library/{library_id}
Base URL: https://api-v2.pandavideo.com.br
PathIt is
/library/{library_id}(singular); thelibrary_idgoes in the URL, not in the body. APUT /librarywithout the id in the URL returns an error.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
library_id | string (uuid) | yes | Unique identifier of the library. |
Request Body
Content-Type: application/json
Body Parameters
| Field | Type | Range | Required | Description |
|---|---|---|---|---|
hls_segment_duration | integer | 4–15 | no | Duration of each HLS segment in seconds. Applies to new uploads and reencodes. |
{
"hls_segment_duration": 10
}
ValidationValues outside the 4–15 range, non-integer, or non-numeric return 400. Because the validator uses
additionalProperties: false, the field must be declared — otherwise the whole request is rejected.
Behavior — what to expect
Applies to new videos onlyChanging the value does not reprocess anything. Existing videos keep the segments they already have; the new value applies to the next upload or reencode.
- The value comes from the library, not the upload. You cannot choose the duration per upload — it always comes from the library configuration. To vary it, change the configuration between uploads, or use separate libraries.
- The value is read when the upload finishes, not when it starts. Changing the configuration during a long upload makes the new value take effect.
Forcing a duration on a single videoThe library value applies to every new upload. To force a specific duration for one video, a reencode of that video can override the library value — the library must have
keep_original_files: true.
Success Response (200)
{
"data": {
"hls_segment_duration": 10
}
}Error Responses
- 400 — value out of range, not an integer, or not numeric.
- 404 — library not found.
Audit log
An audit log entry is queued (via SQS) for each changed attribute under the qualities category (encoding, playback, keep_original_files, compression_mode, hls_segment_duration).
Example — cURL
curl -X PUT "https://api-v2.pandavideo.com.br/library/{library_id}" \
-H "Authorization: {api_key}" \
-H "Content-Type: application/json" \
-d '{"hls_segment_duration": 10}'