# Delivery API

Playback, from the media URL (`base_url`): HLS playlists, posters and subtitle files.

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

Signed playback IDs take an ES256 token your backend signs; public ones take none.

## Signed HLS master playlist [#signed-hls-master-playlist]

`GET /v/{token}/{pid}/master.m3u8`

401 token_expired: fetch a new token. 403 denied: stop.

**Authentication:** None.

Served from the media URL (`base_url`), not the public URL.

### Parameters [#parameters]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | ES256 JWT signed with the app's key: header kid; claims sub (playback ID), aud (v, or t for posters only), iat, exp, optional vid. |
| `pid` | path | string | yes | Playback ID |

### Response 200 [#response-200]

OK

```text
#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,URI="out_01jwmgegachysgyeayn62q1gdp/audio/index.m3u8",GROUP-ID="a",NAME="audio"
#EXT-X-STREAM-INF:BANDWIDTH=5400000,RESOLUTION=1920x1080,AUDIO="a"
out_01jwmgegachysgyeayn62q1gdp/1080p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1200000,RESOLUTION=854x480,AUDIO="a"
out_01jwmgegachysgyeayn62q1gdp/480p/index.m3u8
```

### Errors [#errors]

| Status | Code |
| --- | --- |
| 401 | [`token_expired`](/docs/reference/errors#token_expired) |
| 403 | [`denied`](/docs/reference/errors#denied) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## Public HLS master playlist [#public-hls-master-playlist]

`GET /p/{pid}/master.m3u8`

Only for a public playback ID.

**Authentication:** None.

Served from the media URL (`base_url`), not the public URL.

### Parameters [#parameters-1]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pid` | path | string | yes | Playback ID |

### Response 200 [#response-200-1]

OK

```text
#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,URI="out_01jwmgegachysgyeayn62q1gdp/audio/index.m3u8",GROUP-ID="a",NAME="audio"
#EXT-X-STREAM-INF:BANDWIDTH=5400000,RESOLUTION=1920x1080,AUDIO="a"
out_01jwmgegachysgyeayn62q1gdp/1080p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1200000,RESOLUTION=854x480,AUDIO="a"
out_01jwmgegachysgyeayn62q1gdp/480p/index.m3u8
```

### Errors [#errors-1]

| Status | Code |
| --- | --- |
| 403 | [`denied`](/docs/reference/errors#denied) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## Signed poster [#signed-poster]

`GET /v/{token}/{pid}/poster.jpg`

A t token is enough.

**Authentication:** None.

Served from the media URL (`base_url`), not the public URL.

### Parameters [#parameters-2]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | ES256 JWT signed with the app's key: header kid; claims sub (playback ID), aud (v, or t for posters only), iat, exp, optional vid. |
| `pid` | path | string | yes | Playback ID |

### Response 200 [#response-200-2]

OK

### Errors [#errors-2]

| Status | Code |
| --- | --- |
| 401 | [`token_expired`](/docs/reference/errors#token_expired) |
| 403 | [`denied`](/docs/reference/errors#denied) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## Public poster [#public-poster]

`GET /p/{pid}/poster.jpg`

A public playback ID's poster, a JPEG of a frame near the start.

**Authentication:** None.

Served from the media URL (`base_url`), not the public URL.

### Parameters [#parameters-3]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pid` | path | string | yes | Playback ID |

### Response 200 [#response-200-3]

OK

### Errors [#errors-3]

| Status | Code |
| --- | --- |
| 403 | [`denied`](/docs/reference/errors#denied) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## A track's sidecar VTT [#a-tracks-sidecar-vtt]

`GET /v/{token}/{pid}/tracks/{track_id}.vtt`

A ready track's WebVTT file, for players that show subtitles from a sidecar file rather than the playlist. A chapters track's file is at the same path.

**Authentication:** None.

Served from the media URL (`base_url`), not the public URL.

### Parameters [#parameters-4]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | ES256 JWT signed with the app's key: header kid; claims sub (playback ID), aud (v, or t for posters only), iat, exp, optional vid. |
| `pid` | path | string | yes | Playback ID |
| `track_id` | path | string | yes |  |

### Response 200 [#response-200-4]

OK

```text
WEBVTT

00:00:00.000 --> 00:00:04.200
Today we look at three ways to sort a list.
```

### Errors [#errors-4]

| Status | Code |
| --- | --- |
| 401 | [`token_expired`](/docs/reference/errors#token_expired) |
| 403 | [`denied`](/docs/reference/errors#denied) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## A public track's sidecar VTT [#a-public-tracks-sidecar-vtt]

`GET /p/{pid}/tracks/{track_id}.vtt`

A public playback ID's track as WebVTT.

**Authentication:** None.

Served from the media URL (`base_url`), not the public URL.

### Parameters [#parameters-5]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pid` | path | string | yes | Playback ID |
| `track_id` | path | string | yes |  |

### Response 200 [#response-200-5]

OK

```text
WEBVTT

00:00:00.000 --> 00:00:04.200
Today we look at three ways to sort a list.
```

### Errors [#errors-5]

| Status | Code |
| --- | --- |
| 403 | [`denied`](/docs/reference/errors#denied) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |
