# Share page API

The token endpoint behind a share link's page.

Source: https://clipmux.com/docs/reference/api/share-page

It needs no session or key.

## A share link's playback session [#a-share-links-playback-session]

`POST /s/{secret}/playback`

What the share page's script asks for: a `v` token for the link's playback ID, valid until the earliest of the link's expiry, max(2 x duration, 4 h) and the longest token lifetime. A `viewer_id` of 16 to 64 `[A-Za-z0-9_-]` characters counts as a unique viewer.

**Authentication:** None.

### Parameters [#parameters]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `secret` | path | string | yes |  |

### Request body [#request-body]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `viewer_id` | string | no |  |

```json
{
  "viewer_id": "b7f3k9q2m4x8r1v6t0w5"
}
```

### Response 200 [#response-200]

A token for the link's playback ID

```json
{
  "title": "Lesson 42: Sorting",
  "duration_seconds": 1830.4,
  "base_url": "https://media.example.com",
  "playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
  "token": "eyJhbGciOiJFUzI1NiIs...",
  "expires_at": "2026-11-18T13:30:00Z",
  "poster_url": "https://media.example.com/v/eyJhbGciOiJFUzI1NiIs.../pid_01jmgkyp0c3ct46ees12paekfv/poster.jpg",
  "tracks": [
    {
      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
      "kind": "subtitles",
      "source": "generated",
      "status": "ready",
      "language": "en",
      "name": "English"
    }
  ]
}
```

### Errors [#errors]

| Status | Code |
| --- | --- |
| 400 | [`invalid_request`](/docs/reference/errors#invalid_request) |
| 404 | [`share_not_found`](/docs/reference/errors#share_not_found) |
| 409 | [`asset_not_ready`](/docs/reference/errors#asset_not_ready) |
| 410 | [`share_expired`](/docs/reference/errors#share_expired) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |
