Open a playback session
Code Mode: praxis.content.playbackSessions.create
HTTP: POST /content/v1/playback/sessions
Open one playback of a published content for an end user and get the manifest address a player loads. No platform API key is needed: the caller is the end user’s own Praxis customer access token carried as Authorization: Bearer <access_token>, verified by this door exactly as the customer exchange verifies it. A caller with no token is left to the service, which refuses it RESOURCE_NOT_GRANTED, because a content is always signed and there is no public playback. The organization is taken from the content row, never from the token, and a token that claims another organization is refused. The content must be published (otherwise 403 CONTENT_NOT_PUBLISHED), its allowed_origins must accept the request Origin when the list is not empty (otherwise 403 ORIGIN_NOT_ALLOWED), the token must cover a resource for this content (otherwise 403 RESOURCE_NOT_GRANTED) and the pinned version must be ready (otherwise 409 SOURCE_NOT_READY; retry once readiness is ready). Returns HTTP 201 with the session id, manifest_url (https://content.praxisusercontent.com/{content_id}/{capability}/master.m3u8), expire_time, the renditions, the poster, the title when the player shows it, and the player settings. The playback reads access settings from the content’s latest version and source and player from the live version, so a tightened origin or lifetime takes effect without a republish. This door has its own per-IP request budget: over it answers 429 RATE_LIMITED with Retry-After.
Signature
praxis.content.playbackSessions.create(args:{headers?:{Origin?:string};body:{/** Published content to play, from praxis.content.contents.create or praxis.content.contents.list. */ content_id:string}}):Promise<{/** Object type, always content.playback_session. */ type?:"content.playback_session";/** Playback session id (pbs_…); it identifies this one playback until it expires. */ id?:string;/** The content this playback plays. */ content_id?:string;/** The live version this playback was opened on; a settings save or republish never moves it. */ version?:number;/** Credentialled HLS manifest address on Content own host, https://content.praxisusercontent.com/{content_id}/{capability}/master.m3u8; feed it to a player as it i */ manifest_url?:string;/** RFC 3339 time the manifest stops working; the Kit renews the playback before it. */ expire_time?:string;/** The renditions available to this player, one entry per output height that is ready. */ renditions?:Array<{/** Output height in pixels, one of 480, 720 or 1080. */ height?:number;/** Output width in pixels, derived from the asset aspect ratio at this height. */ width?:number;/** Average bitrate of this rendition in bits per second, as Media reports it. */ bitrate?:number}>;/** Poster image URL from the player settings as it should be shown to the end user; null when none is set. */ poster?:string|null;/** Content title to show beside the player, or null when the player settings hide the title. */ title?:string|null;/** Player settings this playback runs with, taken from the live version. */ player?:{/** Poster image URL shown before playback starts; null by default. */ poster?:string|null;/** Whether the player shows the content title; true by default, and when false the playback title is null. */ show_title?:boolean;/** Player accent colour as */ accent_color?:string|null;/** Quality the player starts with; auto by default, or one output height that this content actually has, one of 480, 720 or 1080. e.g. "auto" */ default_quality?:"auto"|480|720|1080;/** Playback speeds the player offers, each between 0.25 and 4 and the list must contain 1; defaults to 0.75, 1, 1.25, 1.5 and 2. */ speeds?:Array<number>;/** Whether the player shows storyboard previews while scrubbing; true by default. */ storyboard?:boolean;/** Whether the player starts playing without a click; false by default. */ autoplay?:boolean;/** Whether the player resumes at the position the end user left; true by default. */ remember_position?:boolean}}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Origin | header | string | no | Browser page origin the playback is opened from, for example https://school.example.com. Required when the content’s allowed_origins is not empty; it must then match one of its entries exactly. |
Request body
| Required | Content types | Description |
|---|---|---|
| yes | application/json | The content to play. |
Responses
| Status | Content types | Description |
|---|---|---|
| 201 | application/json | The opened session with the manifest address and its expiry. |
| 400 | application/json | INVALID_PARAMS: the request is not shaped the way this face accepts — an unknown or misspelled field, a repeated query parameter, a value outside its allowed range (for example capability_seconds outside 100 to 3000 or a rendition other than 480, 720 or 1080), or a body that is not a JSON object. The error names the field at fault and what it accepts; correct that field and send the request again. |
| 401 | application/json | The credential is missing, malformed or expired. Merchant routes answer UNAUTHENTICATED when the API key or session names no organization; the playback door answers ACCESS_TOKEN_EXPIRED when the end-user token cannot be verified and SIGN_IN_EXPIRED or SIGN_IN_REVOKED when the sign-in behind it is over. Send a valid API key, or sign the end user in again for a fresh access token, then retry. |
| 403 | application/json | The credential is valid but the playback is refused: CONTENT_NOT_PUBLISHED when the content is not published, RESOURCE_NOT_GRANTED when the end-user token does not cover this content, CUSTOMER_BLOCKED when the directory has blocked that end user, and ORIGIN_NOT_ALLOWED when the request Origin is not in the content allowed_origins. Fix the cause the message names — publish the content, grant a resource for it, unblock the end user or add the origin — then open the playback again. |
| 404 | application/json | The reference does not name a content this organization owns: CONTENT_NOT_FOUND for an unknown, foreign or archived content id, VERSION_NOT_FOUND for a version number that does not exist, SOURCE_NOT_FOUND when the library or asset behind a source is gone. Read the current id from praxis.content.contents.list (or praxis.media for the asset) and retry with that; never construct an id. |
| 409 | application/json | CONTENT_INVALID_STATE: the act is not allowed in the content current state — an archived content is final, unpublish needs a published content, archive needs a draft or unpublished one. SOURCE_NOT_READY: Media is still transcoding a wanted rendition of the pinned asset version, so a publish is refused; wait until readiness is ready and publish again. |
| 429 | application/json | RATE_LIMITED: the caller IP has spent this door per-minute anonymous budget (a classroom behind one address must not spend the exchange own budget). Wait the seconds in the Retry-After response header and send the request again; do not retry immediately. |
| 502 | application/json | UPSTREAM_UNAVAILABLE: a dependency refused the call — Media (the transcoder or the manifest issuer) or, for a playback, the end-user token verifier. Nothing was written; retry later, and if it persists report the time and the request path. |
| 503 | application/json | UPSTREAM_UNAVAILABLE: this face is not usable in this environment — the CONTENT service binding is unwired, or the anonymous rate limiter is unavailable or misconfigured so the door fails closed. Use an environment where the face is wired, or retry when the dependency is back. |