# API reference

Every route of the integration API, with its parameters, an example and its errors.

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

The routes an app's backend, its browser uploader and its player use, and the webhooks the app receives. Requests and responses are JSON, with bodies up to 64 KiB. Every POST takes an `Idempotency-Key`. Errors are `{"error": {"code", "message", ...details}}`; a `429 rate_limited` carries `Retry-After`. The management API, which the dashboard uses with the owner's session, is not described here.

Every instance serves this description as OpenAPI 3.1 at `https://video.example.com/openapi.json`, with no credential, so a code generator or an agent reads the version the instance runs. The copy on this site is at [/openapi.json](/openapi.json).

## Authentication [#authentication]

- **API key** (`Authorization: Bearer …`): An app's API key (cmx_…), from your backend only. Scopes: uploads:write, assets:read, assets:write, analytics:read.
- **Upload token** (`Authorization: Bearer …`): An upload's upload_token: safe for the browser, reaches only that upload.

## Idempotency [#idempotency]

A retry with the same key and request returns the first response; a different request is 422 idempotency_key_reused.

## Errors [#errors]

Every error is JSON: `{"error": {"code": "snake_case", "message": "…", …details}}`. The [errors reference](/docs/reference/errors) lists every code and what to do about it.

## Videos [#videos]

- [Uploads](/docs/reference/api/uploads): Resumable browser uploads.
- [Videos](/docs/reference/api/videos): A video is an asset in the API: its status, playback IDs, tracks and renditions.
- [Subtitles and chapters](/docs/reference/api/subtitles-and-chapters): Tracks made after a video is ready: subtitles from speech, and chapters from an LLM.
- [Playback IDs](/docs/reference/api/playback-ids): Each video has one or more playback IDs, public or signed, each revocable on its own.
- [Share links](/docs/reference/api/share-links): A share link plays one video for anyone holding its URL, until it expires or is revoked.

## Your app [#your-app]

- [App](/docs/reference/api/app): The API key's own app: its URLs, scopes, token lifetime and signing keys.
- [Events](/docs/reference/api/events): The same events your webhook endpoints receive, read by long-polling.
- [Analytics](/docs/reference/api/analytics): Views, watch time, unique viewers and bytes delivered, counted at delivery.
- [App pairing](/docs/reference/api/app-pairing): How `npx @clipmux/node init` gets an app's credentials without anyone copying a secret.

## Playback [#playback]

- [Delivery](/docs/reference/api/delivery): Playback, from the media URL (`base_url`): HLS playlists, posters and subtitle files.
- [Share page](/docs/reference/api/share-page): The token endpoint behind a share link's page.
