Skip to content

Playback ​

All paths are under /v1. Responses use { data, meta }; errors are RFC 9457 problems with code. "User" means a platform access token; "Public" also accepts no token (guest).

Lease (one active device per account) ​

A device must hold the lease to fetch full manifests and keys. Claiming from another device increments the fencing token and sends playback:preempted to the account's sockets; the named device must pause. Heartbeat every heartbeatSeconds; the lease lapses after expiresInSeconds.

MethodPathAuthBodyResponseErrors
POST/playback/leaseUser{ deviceId }LeaseViewDEVICE_NOT_FOUND
POST/playback/lease/heartbeatUser{ deviceId, fencingToken }LeaseViewPLAYBACK_LEASE_STALE
POST/playback/lease/releaseUser{ deviceId, fencingToken }{ status: "ok" }—

LeaseView: { deviceId, fencingToken, heartbeatSeconds, expiresInSeconds }.

Manifest and keys ​

MethodPathAuthQueryResponseErrors
GET/playback/manifestPubliccontentType (recording, video, episode, dj_set), contentId, deviceId?, fencingToken?, lossless?ManifestViewPLAYBACK_CONTENT_NOT_FOUND, PLAYBACK_LEASE_REQUIRED, PLAYBACK_LEASE_STALE, RATE_LIMITED
GET/playback/keys/:keyIdPublic (preview) / User (full)deviceId?, fencingToken?16 raw bytes, application/octet-streamNOT_FOUND, PLAYBACK_NOT_ENTITLED (remedy subscribe), PLAYBACK_LEASE_REQUIRED, PLAYBACK_LEASE_STALE

Guests and non-entitled users always get the 15 s preview rendition (reason: guest / not_entitled). Entitled users get the full rendition and must send the lease proof. lossless=true is honoured only when the plan includes it.

ManifestView: { contentType, contentId, rendition: "full"|"preview", reason, manifestUrl, expiresAt, keyUrl|null, durationMs, previewStartMs|null, previewDurationMs|null, codecs[], isLossless }. Cache-Control: no-store.

Event ingest ​

MethodPathAuthBodyResponseErrors
POST/playback/eventsUser{ deviceId, events: PlayEvent[1..200] }202 { accepted }VALIDATION_FAILED, RATE_LIMITED

PlayEvent: { playId (uuid, one per play of one item), sequence, type, clientTime, contentType, contentId, rendition, positionMs, context: { type, id|null }, fromPositionMs? (seek), listenedMs? (offline_play), bitrateKbps?, codec?, errorCode?, isOffline? }. Types: start, progress (every 10 s), pause, resume, seek, skip, complete, end, error, quality_change, offline_play. Context types: album, playlist, radio, together, search, moment, dj_set, artist, library, show, unknown. The country comes from the edge header (CF-IPCountry / X-Country-Code), never the body.

Events are queued (playback-ingest) and filed in monthly partitions of play_events. A play becomes a qualified stream once heard for min(30 s, duration / 3) of a full rendition; the listener's paid/trial state at play time is recorded with it. Retries and reordering are safe (playId + sequence).

Queue ​

MethodPathAuthBodyResponseErrors
GET/me/playback/queueUser—{ queue: QueueView | null }—
PUT/me/playback/queueUser{ context, items: ContentRef[≤500], startIndex?, positionMs?, isShuffled? }QueueViewPLAYBACK_QUEUE_TOO_LONG
PATCH/me/playback/queueUserany of { isShuffled, repeatMode (off/all/one), currentItemId, positionMs, crossfadeMs (0-12000), isAutomix }QueueViewNOT_FOUND
POST/me/playback/queue/itemsUser{ items: ContentRef[], placement: "next"|"end" }QueueViewNOT_FOUND, PLAYBACK_QUEUE_TOO_LONG
DELETE/me/playback/queue/items/:itemIdUser—QueueViewNOT_FOUND
POST/me/playback/queue/advanceUser{ direction: "next"|"previous" }QueueViewNOT_FOUND
POST/playback/automix/planUser{ recordingIds[2..51], crossfadeMs? }{ transitions: TransitionHint[] }—

QueueView.items are in play order (shuffle applied; user-queued items play right after the current one). TransitionHint: { fromRecordingId, toRecordingId, style: beatmatch|crossfade|cut, startAtMs, enterAtMs, crossfadeMs, tempoRatio, isKeyCompatible, gainDb }; pairs without analysis are omitted.

History ​

MethodPathAuthQuery / BodyResponse
GET/me/recently-playedUsercursor?, limit?page of { contentType, contentId, context, playedAt, playCount }
GET/me/resume-positionsUseritems=episode:<id>,... (≤100){ items: ResumePosition[] }
PUT/me/resume-positionsUser{ contentType, contentId, positionMs, durationMs, isCompleted? }{ status: "ok" }
GET/me/continue-listeningUserlimit? (≤50){ items: ResumePosition[] }

Resume positions are also written automatically from ingest for episodes and DJ sets.

Socket namespace /playback ​

DirectionEventPayloadAck
client → serverlease:claim{ deviceId }LeaseView
client → serverlease:heartbeat{ deviceId, fencingToken }LeaseView or PLAYBACK_LEASE_STALE
client → serverlease:release{ deviceId, fencingToken }{ status: "ok" }
client → serverevents:ingest{ deviceId, events }{ accepted }
server → clientplayback:preempted{ deviceId, fencingToken, claimedByDeviceId, currentFencingToken }room user:<id>
server → clientqueue:updated{ version }room user:<id>

Clearing history ​

DELETE /me/recently-played and DELETE /me/recently-played/:contentType/:contentId clear the history list only. Qualified streams, charts and royalties are untouched.

Clearing history ​

DELETE /me/recently-played and DELETE /me/recently-played/:contentType/:contentId clear the history list only; qualified streams, charts and royalties stay.

Keys for AVPlayer ​

When GET /playback/manifest is called for a full rendition with deviceId and fencingToken, the playlist's EXT-X-KEY URI carries ?t=<signed proof> bound to that key, the person, the session and the lease, valid until the playlist expires. GET /playback/keys/:keyId?t=... then needs no header; the lease and entitlement are still checked. Without t, send the Bearer token and ?deviceId=&fencingToken= as before.

Plemuz API v2