VideohatiDocs
API referencePlayback

Create an anonymous playback session for a shared video

Create an anonymous playback session for a shared video

POST/v1/playback/embed-sessions

Unauthenticated session mint for videos whose visibility is public or unlisted — called by the hosted watch/embed pages (and usable from any page) so viewers never need a customer server to mint tokens. Sessions carry every protection of the authenticated mint: signed segment URLs, the edge session mirror, the heartbeat-gated key, geo/ASN policy, and the account overdraft gate. The per-viewer concurrency cap keys on a hash of the viewer IP. Rate limit: 30 requests per 60 s per IP.

Error codes: invalid_body (400), video_not_found (404 — also returned when the video is private or the project has direct play off, so the endpoint leaks nothing about unshared content), embed_not_allowed (403 — the calling site is outside the referrer allowlist), embed_token_required / embed_token_invalid / embed_token_expired (403 — embed token auth is on and the supplied token is missing, malformed, or past expires), video_not_playable (409), insufficient_balance (402), embed_tokens_unconfigured (503 — the API has no EMBED_TOKEN_KEY_MASTER).

Authentication

  • This operation needs no authentication.

Parameters

This operation takes no parameters.

Request body

required

Content type: application/json

Schema: EmbedSessionCreateRequest

{
  "videoId": "01JZ9WV3N8GQ5T2M7K4C6XBARH"
}

Responses

StatusMeaning
201Playback session created.
400The request body or query failed validation. The per-operation description lists the exact error.code values.
402The account's balance is below its plan overdraft limit.
403The credential is valid but does not permit this action. The per-operation description lists the exact error.code values.
404The resource does not exist or is not visible to this caller.
409The request conflicts with the resource's current state. The per-operation description lists the exact error.code values.
429Rate limit exceeded.
503Embed token verification is not configured on this API.

Example request

{
  "videoId": "01JZ9WV3N8GQ5T2M7K4C6XBARH"
}

Try it

POST
/v1/playback/embed-sessions
No authentication

API playground

Send a live request to the Videohati API; this operation needs no authentication.

https://api.staging.videohati.com/v1/playback/embed-sessions