Pagination and limits
How list endpoints page their results, and the size, time and rate limits of the API.
List endpoints return one page at a time, and every request has size and time limits. Design your integration around them from the start.
Response shape
A successful response wraps its payload in data. A list adds meta:
{
"data": [
{ "id": "6f1c2b9e-4a7d-4f3e-9b8a-2d5c7e1f0a34", "title": "Lesson 26", "encoding_status": "ready" }
],
"meta": { "page": 2, "per_page": 25, "total": 137 }
}Pagination
| Query parameter | Default | Allowed |
|---|---|---|
page | 1 | 1 or more |
per_page | 25 | 1 to 100 |
meta.total counts every item across all pages, so the last page is ceil(total / per_page). A page past the end returns an empty data list.
const base = 'https://api.octavideo.tech/api/v1';
const headers = { AccessKey: process.env.OCTAVIDEO_KEY };
const videos = [];
for (let page = 1; ; page++) {
const res = await fetch(`${base}/videos?page=${page}&per_page=100`, { headers });
if (!res.ok) throw new Error(`OctaVideo ${res.status}`);
const { data, meta } = await res.json();
videos.push(...data);
if (page * meta.per_page >= meta.total) break;
}Limits
| Limit | Value | Error when exceeded |
|---|---|---|
| JSON request body | 1 MiB | 413 payload_too_large |
| Upload file | 10 GiB | 413 payload_too_large |
| Request time | 30 seconds | 504 Gateway Timeout (no JSON body) |
| Upload time | 2 hours | the connection closes |
| Items per page | 100 | 400 validation_failed |
| Chapters per video | 200 | 400 validation_failed |
| Videos added to a collection per request | 100 | 400 validation_failed |
OTP lifetime (ttl_seconds) | 1 second to 24 hours, 5 minutes by default | 400 validation_failed |
Rate limits
When you send too many requests, the API answers 429 rate_limited with a Retry-After header in seconds. Wait that long, then retry. Playback authorization in the player is limited per library and viewer IP, which protects your videos from scripted abuse.
During the private beta the exact rate limits can change. Build your client to honour Retry-After rather than a fixed number.
Strict JSON
The API rejects JSON bodies with unknown fields, trailing data or more than one value, with 400 bad_request. Send only the documented fields, and set Content-Type: application/json.