Share links API
A share link plays one video for anyone holding its URL, until it expires or is revoked.
Create a share link
POST /v1/assets/{id}/shares
Makes a share link and its own signed playback ID. url is the page to send. name is one line of up to 100 characters; expires_at must be in the future and can't be changed later. Allowed while the asset is processing.
Authentication: An API key with assets:write.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | Asset ID (ast_…). |
Idempotency-Key | header | string | no | A retry with the same key and request returns the first response; a different request is 422 idempotency_key_reused. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | |
expires_at | string (date-time) | no |
{
"name": "For the review",
"expires_at": "2026-12-01T00:00:00Z"
}Response 201
Created
{
"id": "shr_01jepn315k8tfeyh86qtbhnna7",
"asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
"name": "For the review",
"url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
"playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
"expires_at": "2026-12-01T00:00:00Z",
"status": "active",
"created_at": "2026-11-18T09:30:00Z"
}Errors
| Status | Code |
|---|---|
| 400 | invalid_request |
| 401 | unauthorized |
| 403 | insufficient_scope |
| 404 | not_found |
| 409 | asset_deleted |
| 409 | too_many_playback_ids |
| 409 | idempotency_in_progress |
| 422 | idempotency_key_reused |
| 429 | rate_limited |
List an asset's share links
GET /v1/assets/{id}/shares
The asset's share links, newest first, each with views_30d: its views over the last 30 UTC days.
Authentication: An API key with assets:read.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | Asset ID (ast_…). |
Response 200
Newest first
{
"data": [
{
"id": "shr_01jepn315k8tfeyh86qtbhnna7",
"asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
"name": "For the review",
"url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
"playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
"expires_at": "2026-12-01T00:00:00Z",
"status": "active",
"created_at": "2026-11-18T09:30:00Z",
"views_30d": 27
}
]
}Errors
| Status | Code |
|---|---|
| 400 | invalid_request |
| 401 | unauthorized |
| 403 | insufficient_scope |
| 404 | not_found |
| 429 | rate_limited |
Revoke a share link
DELETE /v1/shares/{id}
Revokes the link's playback ID: 200 once unpublished, 202 while revoking. Revoking again changes nothing.
Authentication: An API key with assets:write.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response 200
Unpublished
{
"id": "shr_01jepn315k8tfeyh86qtbhnna7",
"asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
"name": "For the review",
"url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
"playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
"expires_at": "2026-12-01T00:00:00Z",
"status": "revoked",
"created_at": "2026-11-18T09:30:00Z"
}Response 202
Revoking
{
"id": "shr_01jepn315k8tfeyh86qtbhnna7",
"asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
"name": "For the review",
"url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
"playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
"expires_at": "2026-12-01T00:00:00Z",
"status": "revoked",
"created_at": "2026-11-18T09:30:00Z"
}Errors
| Status | Code |
|---|---|
| 400 | invalid_request |
| 401 | unauthorized |
| 403 | insufficient_scope |
| 404 | not_found |
| 429 | rate_limited |
A signed master.m3u8 URL for a share link
POST /v1/shares/{id}/stream-url
A signed master.m3u8 URL for players that can't open the share page. It can't refresh: it lasts until the link's expiry or the longest token lifetime, whichever is first, and stops when the link is revoked.
Authentication: An API key with assets:write.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response 200
The URL
{
"url": "https://media.example.com/v/eyJhbGciOiJFUzI1NiIs.../pid_01jmgkyp0c3ct46ees12paekfv/master.m3u8",
"expires_at": "2026-11-25T09:30:00Z"
}Errors
| Status | Code |
|---|---|
| 400 | invalid_request |
| 401 | unauthorized |
| 403 | insufficient_scope |
| 404 | not_found |
| 409 | share_expired |
| 409 | share_revoked |
| 409 | asset_not_ready |
| 429 | rate_limited |