# Errors

Every error code the API returns, what it means and what to do.

Source: https://clipmux.com/docs/reference/errors

Every error is JSON, `{"error": {"code": "snake_case", "message": "…", …details}}`. Act on `code`; `message` is for people and may change. Retry only what says to: a 4xx other than 409 `idempotency_in_progress` and 429 fails the same way again.

## 400 Bad Request [#400-bad-request]

### `import_url_refused` [#import_url_refused]

The URL is not a public http(s) URL, or it carries credentials. Use a public URL, or upload the file instead.

Returned by: `POST /v1/assets`.

### `invalid_cursor` [#invalid_cursor]

The `cursor` is not one this API returned. Start again without it, or pass the `next_cursor` you were given.

Returned by: `GET /v1/assets`.

### `invalid_parts` [#invalid_parts]

Some parts are missing or their ETags don't match what storage holds. List the stored parts, upload the rest, and complete again.

Returned by: `POST /v1/uploads/{id}/complete`.

### `invalid_request` [#invalid_request]

The body or a parameter is malformed or out of range; `message` names it. Fix the request; retrying the same one fails again.

Returned by: `POST /v1/uploads`, `POST /v1/uploads/{id}/parts`, `GET /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`, `POST /v1/uploads/{id}/cancel`, `POST /v1/assets`, `GET /v1/assets`, `GET /v1/assets/{id}`, `PATCH /v1/assets/{id}`, `DELETE /v1/assets/{id}`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `GET /v1/assets/{id}/tracks/{track_id}`, `DELETE /v1/assets/{id}/tracks/{track_id}`, `GET /v1/assets/{id}/tracks/{track_id}/transcript`, `POST /v1/assets/{id}/playback-ids`, `DELETE /v1/assets/{id}/playback-ids/{pid}`, `POST /v1/assets/{id}/shares`, `GET /v1/assets/{id}/shares`, `DELETE /v1/shares/{id}`, `POST /v1/shares/{id}/stream-url`, `GET /v1/events`, `GET /v1/app`, `GET /v1/analytics`, `GET /v1/analytics/assets/{id}`, `POST /v1/app-pairings`, `POST /v1/app-pairings/poll`, `POST /s/{secret}/playback`.

## 401 Unauthorized [#401-unauthorized]

### `token_expired` [#token_expired]

The playback token's `exp` has passed. Fetch a new token and retry; `<clipmux-player>` does this by itself.

Returned by: `GET /v/{token}/{pid}/master.m3u8`, `GET /v/{token}/{pid}/poster.jpg`, `GET /v/{token}/{pid}/tracks/{track_id}.vtt`.

### `unauthorized` [#unauthorized]

No credential, or a wrong or revoked one. Check the API key or upload token; `npx @clipmux/node doctor` checks an app's key.

Returned by: `POST /v1/uploads`, `POST /v1/uploads/{id}/parts`, `GET /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`, `POST /v1/uploads/{id}/cancel`, `POST /v1/assets`, `GET /v1/assets`, `GET /v1/assets/{id}`, `PATCH /v1/assets/{id}`, `DELETE /v1/assets/{id}`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `GET /v1/assets/{id}/tracks/{track_id}`, `DELETE /v1/assets/{id}/tracks/{track_id}`, `GET /v1/assets/{id}/tracks/{track_id}/transcript`, `POST /v1/assets/{id}/playback-ids`, `DELETE /v1/assets/{id}/playback-ids/{pid}`, `POST /v1/assets/{id}/shares`, `GET /v1/assets/{id}/shares`, `DELETE /v1/shares/{id}`, `POST /v1/shares/{id}/stream-url`, `GET /v1/events`, `GET /v1/app`, `GET /v1/analytics`, `GET /v1/analytics/assets/{id}`.

## 403 Forbidden [#403-forbidden]

### `denied` [#denied]

The token is valid but doesn't cover this request: another playback ID or app, a poster-only token, or a revoked signing key. Stop; don't retry.

Returned by: `GET /v/{token}/{pid}/master.m3u8`, `GET /p/{pid}/master.m3u8`, `GET /v/{token}/{pid}/poster.jpg`, `GET /p/{pid}/poster.jpg`, `GET /v/{token}/{pid}/tracks/{track_id}.vtt`, `GET /p/{pid}/tracks/{track_id}.vtt`.

### `insufficient_scope` [#insufficient_scope]

The API key lacks the scope this route needs. Create a key with it: `uploads:write`, `assets:read` and `assets:write` are the defaults, `analytics:read` is asked for.

Returned by: `POST /v1/uploads`, `POST /v1/uploads/{id}/parts`, `GET /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`, `POST /v1/uploads/{id}/cancel`, `POST /v1/assets`, `GET /v1/assets`, `GET /v1/assets/{id}`, `PATCH /v1/assets/{id}`, `DELETE /v1/assets/{id}`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `GET /v1/assets/{id}/tracks/{track_id}`, `DELETE /v1/assets/{id}/tracks/{track_id}`, `GET /v1/assets/{id}/tracks/{track_id}/transcript`, `POST /v1/assets/{id}/playback-ids`, `DELETE /v1/assets/{id}/playback-ids/{pid}`, `POST /v1/assets/{id}/shares`, `GET /v1/assets/{id}/shares`, `DELETE /v1/shares/{id}`, `POST /v1/shares/{id}/stream-url`, `GET /v1/events`, `GET /v1/app`, `GET /v1/analytics`, `GET /v1/analytics/assets/{id}`.

### `upload_mismatch` [#upload_mismatch]

The upload token belongs to another upload. Use the token returned with this upload.

Returned by: `POST /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`.

## 404 Not Found [#404-not-found]

### `agent_source_not_found` [#agent_source_not_found]

The PC agent's file is unknown, or was already attached. Push it again with `clipmux push --local`.

Returned by: `POST /v1/assets`.

### `not_found` [#not_found]

No such object in this app, or it was revoked. For playback, the ID is unknown or revoked.

Returned by: `POST /v1/uploads/{id}/parts`, `GET /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`, `POST /v1/uploads/{id}/cancel`, `GET /v1/assets/{id}`, `PATCH /v1/assets/{id}`, `DELETE /v1/assets/{id}`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `GET /v1/assets/{id}/tracks/{track_id}`, `DELETE /v1/assets/{id}/tracks/{track_id}`, `GET /v1/assets/{id}/tracks/{track_id}/transcript`, `POST /v1/assets/{id}/playback-ids`, `DELETE /v1/assets/{id}/playback-ids/{pid}`, `POST /v1/assets/{id}/shares`, `GET /v1/assets/{id}/shares`, `DELETE /v1/shares/{id}`, `POST /v1/shares/{id}/stream-url`, `GET /v1/analytics/assets/{id}`, `GET /v/{token}/{pid}/master.m3u8`, `GET /p/{pid}/master.m3u8`, `GET /v/{token}/{pid}/poster.jpg`, `GET /p/{pid}/poster.jpg`, `GET /v/{token}/{pid}/tracks/{track_id}.vtt`, `GET /p/{pid}/tracks/{track_id}.vtt`.

### `pairing_not_found` [#pairing_not_found]

The pairing is unknown, or its credentials were already collected. Start a new pairing.

Returned by: `POST /v1/app-pairings/poll`.

### `share_not_found` [#share_not_found]

The share link is unknown or revoked, its video was deleted, or its app is disabled.

Returned by: `POST /s/{secret}/playback`.

## 409 Conflict [#409-conflict]

### `asset_deleted` [#asset_deleted]

The video was deleted. Nothing more can change it.

Returned by: `PATCH /v1/assets/{id}`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `POST /v1/assets/{id}/playback-ids`, `POST /v1/assets/{id}/shares`.

### `asset_not_ready` [#asset_not_ready]

The video isn't ready yet. Wait for `video.asset.ready`, then retry.

Returned by: `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `POST /v1/shares/{id}/stream-url`, `POST /s/{secret}/playback`.

### `chapters_not_connected` [#chapters_not_connected]

No LLM is connected for chapters. Connect one under Captions and AI in the dashboard.

Returned by: `POST /v1/assets/{id}/tracks`.

### `idempotency_in_progress` [#idempotency_in_progress]

A request with this Idempotency-Key is still running. Wait a moment and retry with the same key.

Returned by: `POST /v1/uploads`, `POST /v1/assets`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `POST /v1/assets/{id}/playback-ids`, `POST /v1/assets/{id}/shares`.

### `job_active` [#job_active]

Another job is changing this video; `job_id` names it. Wait for it, or pass `supersede: true` to cancel it.

Returned by: `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`.

### `no_audio` [#no_audio]

The video has no audio track, so there is nothing to transcribe.

Returned by: `POST /v1/assets/{id}/tracks`.

### `share_expired` [#share_expired]

The share link has expired. Make a new one. Also returned as 410.

Returned by: `POST /v1/shares/{id}/stream-url`, `POST /s/{secret}/playback`.

### `share_revoked` [#share_revoked]

The share link was revoked. Make a new one.

Returned by: `POST /v1/shares/{id}/stream-url`.

### `size_mismatch` [#size_mismatch]

The stored file's size differs from the `size` the upload declared. Create a new upload with the right size.

Returned by: `POST /v1/uploads/{id}/complete`.

### `source_missing` [#source_missing]

The video's source file was not kept, so it can't be re-encoded.

Returned by: `POST /v1/assets/{id}/reencode`.

### `source_unavailable` [#source_unavailable]

The source stays on a PC agent that was revoked. Push it again from a connected PC.

Returned by: `POST /v1/assets`.

### `subtitles_not_ready` [#subtitles_not_ready]

Chapters are made from subtitles, which aren't ready. Make subtitles first, or wait for them.

Returned by: `POST /v1/assets/{id}/tracks`.

### `too_many_playback_ids` [#too_many_playback_ids]

A video has at most 1000 playback IDs. Revoke some first.

Returned by: `POST /v1/assets/{id}/playback-ids`, `POST /v1/assets/{id}/shares`.

### `track_not_ready` [#track_not_ready]

The track isn't ready yet. Wait for `video.asset.track.ready`.

Returned by: `GET /v1/assets/{id}/tracks/{track_id}/transcript`.

### `upload_expired` [#upload_expired]

The upload wasn't completed in time. Create a new upload.

Returned by: `POST /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`.

### `upload_missing` [#upload_missing]

Storage no longer has this upload's parts. Create a new upload.

Returned by: `POST /v1/uploads/{id}/complete`.

### `upload_not_active` [#upload_not_active]

The upload has already completed, been cancelled or expired. Create a new upload, with a new Idempotency-Key.

Returned by: `POST /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`.

## 413 Content Too Large [#413-content-too-large]

### `too_large` [#too_large]

The file is larger than this instance or its storage allows, or a request body is larger than its route accepts.

Returned by: `POST /v1/uploads`.

## 422 Unprocessable Content [#422-unprocessable-content]

### `idempotency_key_reused` [#idempotency_key_reused]

The Idempotency-Key was used with a different request. Use a new key for a new request.

Returned by: `POST /v1/uploads`, `POST /v1/assets`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `POST /v1/assets/{id}/playback-ids`, `POST /v1/assets/{id}/shares`.

## 429 Too Many Requests [#429-too-many-requests]

### `rate_limited` [#rate_limited]

Too many requests. Wait `Retry-After` seconds (also `retry_after` in the details), then retry.

Returned by: `POST /v1/uploads`, `POST /v1/uploads/{id}/parts`, `GET /v1/uploads/{id}/parts`, `POST /v1/uploads/{id}/complete`, `POST /v1/uploads/{id}/cancel`, `POST /v1/assets`, `GET /v1/assets`, `GET /v1/assets/{id}`, `PATCH /v1/assets/{id}`, `DELETE /v1/assets/{id}`, `POST /v1/assets/{id}/reencode`, `POST /v1/assets/{id}/tracks`, `GET /v1/assets/{id}/tracks/{track_id}`, `DELETE /v1/assets/{id}/tracks/{track_id}`, `GET /v1/assets/{id}/tracks/{track_id}/transcript`, `POST /v1/assets/{id}/playback-ids`, `DELETE /v1/assets/{id}/playback-ids/{pid}`, `POST /v1/assets/{id}/shares`, `GET /v1/assets/{id}/shares`, `DELETE /v1/shares/{id}`, `POST /v1/shares/{id}/stream-url`, `GET /v1/events`, `GET /v1/app`, `GET /v1/analytics`, `GET /v1/analytics/assets/{id}`, `POST /v1/app-pairings`, `POST /v1/app-pairings/poll`, `POST /s/{secret}/playback`, `GET /v/{token}/{pid}/master.m3u8`, `GET /p/{pid}/master.m3u8`, `GET /v/{token}/{pid}/poster.jpg`, `GET /p/{pid}/poster.jpg`, `GET /v/{token}/{pid}/tracks/{track_id}.vtt`, `GET /p/{pid}/tracks/{track_id}.vtt`.

### `too_many_pairings` [#too_many_pairings]

Ten pairings are already waiting for the owner. Wait for one to be approved or to expire.

Returned by: `POST /v1/app-pairings`.

## A video's error_code [#a-videos-error_code]

When a video's `status` is `errored`, its `error_code` says why. A failed re-encode leaves the video playing and puts the code on the `video.asset.reencode_failed` event's `job`.

| Code | What happened |
| --- | --- |
| `upload_expired` | The upload wasn't completed in time. |
| `upload_cancelled` | The upload was cancelled. |
| `import_failed` | Fetching the URL failed. |
| `import_too_large` | The file at the URL is larger than this instance allows. |
| `import_url_refused` | The URL, or a redirect it followed, is not public. |
| `unsupported_source` | The file is not a video ffmpeg can read. |
| `transcode_failed` | Encoding failed after every retry. |
| `processing_failed` | Processing failed for another reason; the job's logs say why. |
| `source_download_failed` | The worker couldn't download the source from storage. |
| `source_changed` | The source in storage changed while it was being processed. |
| `source_missing` | The source is no longer in storage. |
| `scratch_full` | The worker didn't have the disk for the job: it saw before encoding that the ladder wouldn't fit, or the disk filled during the download or encode. The job may move to a fallback. |
| `job_timeout` | The job ran past its time limit. |
| `worker_lost` | The worker stopped answering mid-job, after every retry. |
| `worker_stopped` | The worker was stopped mid-job, after every retry. |
| `commit_failed` | The finished output couldn't be committed. |
| `upload_failed` | The worker couldn't upload the output to storage. |
| `agent_unavailable` | The PC agent holding the source is no longer connected. |
| `app_disabled` | The video's app was disabled. |

## A track's error_code [#a-tracks-error_code]

When a subtitles or chapters track's `status` is `errored`, its `error_code` says why.

| Code | What happened |
| --- | --- |
| `no_audio` | The video has no audio. |
| `transcribe_failed` | Speech recognition failed. |
| `transcribe_unavailable` | No worker or speech API can transcribe now. |
| `transcript_invalid` | The transcript that came back was not valid. |
| `speech_api_rejected` | The speech API refused the request; check its key and model. |
| `speech_api_unavailable` | The speech API kept failing. |
| `subtitles_failed` | Chapters need subtitles, which failed. |
| `llm_not_connected` | No LLM is connected for chapters. |
| `llm_unavailable` | The model kept failing, through three tries. |
| `model_rejected` | The model's provider refused the request; check its key and model. |
| `model_refused` | The model declined to write chapters for this transcript. |
| `invalid_model_output` | The model's chapters were still invalid after one corrective re-prompt. |
| `transcript_too_large` | The transcript makes a prompt over 512 KB, which is never truncated. |
