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), video_not_playable (409), insufficient_balance (402).

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.
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.

Example request

{
  "videoId": "01JZ9WV3N8GQ5T2M7K4C6XBARH"
}

Try it

POST
/v1/playback/embed-sessions
Test mode only

API playground

Send a live request to api.videohati.com with a test-mode key.

This playground blocks vh_live_ keys. Use a key that starts with vh_test_ only; a request with a live key never leaves your browser.

The key is stored in your browser on docs.videohati.com only.