Read the status, then the code
- Read the HTTP status to know the kind of failure.
- Read the
codeto know the exact cause. Branch oncode, not on the text. - Use the Retry column to decide what to do next.
Error body
Most errors use the problem format (application/problem+json, RFC 9457):
Some responses do not use this format. These are the exceptions:
- CDN errors also send the code in the
X-Segmnt-Errorheader. Thetitleis a short label, anddetailrepeats it. - Unknown API route: a path that does not exist returns
404with the body{"error":"not_found"}. There is nocodefield. Match on the status. - CSRF refusal: a browser request from a site that is not allowed returns
403with the body{"error":"csrf_rejected"}. There is nocodefield. - Embed page errors: the embed page (
/e/) returns an HTML page, not a JSON body. It uses the same status andcodevalues as the table below.
Examples
These examples show the format of each response. The values are examples. 1. Missing sign-in on an API call (401):
Missing or wrong API key.
The code is the same.
2. A protected video with no token (403, CDN):
405):
Error codes
This table lists every public error code once. Codes that come from the video CDN are marked CDN.
If a response has a status or
code that is not in this table, do not guess.
Retry 5xx with backoff, and 429 after Retry-After. Stop on any other 4xx
status, and report the full response to us.
Rate limits
Rate limits protect the API. Limits are counted per minute.rate_limited sends a Retry-After header. Its
value is a number of seconds. Wait that long, then retry. The /health route and
CORS preflight requests are never counted.
Your server is one client IP. If many of your users share one server, they can
reach the limit together. Batch requests, or spread calls over time.
Errors that need extra care
storage_unavailable (503)
Video storage is down for a short time. The response uses the problem format.
It does not include a Retry-After header.
- On create: no upload started. Call create again.
- On complete: the upload is not lost. Call complete again with the same parts.
video_not_ready (409) and video_unavailable (403, CDN)
These mean the video is not ready to play. Do not loop on the request. Wait for a
video.ready webhook, then request a token. See Webhooks.
Playback tokens
Atoken_expired or ip_mismatch error needs a new token, not a retry with the
same token. Create tokens on your server each time you show a video. See
Create playback tokens on your server.
Retry rule of thumb
- Retry
429afterRetry-After. Retry5xxwith backoff. The one429without a header istoo_many_open_uploads: wait until one upload ends. - Do not retry
400,401,403,404,405or409as they are. Fix the request, get a new credential or token, or wait for the state to change. The one exception is a key-prefixconflict(409): retry it once. - Do not retry in a loop a
503with anot_configured,*_not_configured,billing_pausedorbilling_unavailablecode. Nothing changes until we change the setup.
Where to go next
- Create playback tokens on your server: the
video_not_readyand token paths. - Direct upload: the
upload_closed,token_usedandstorage_unavailablepaths. - How playback protection works: the CDN
403codes. - Feature status: what is available, beta and coming soon.