Skip to main content
A playback token is a short, signed pass that lets one video play on one domain for a short time. Your server creates it, and the CDN checks it on every request.
Never put your API key in a web page. The API key creates tokens, so anyone with the key can play your videos anywhere. Tokens are safe in a page. Keys are not.

Public videos need no token

Status: Coming soon. The per-video public access mode is not released yet, so every video needs a token today. This section describes how it will work. See Feature status.
When the mode ships, a video whose access mode is Public will play with no token, so you will not call this endpoint for it. Build the embed URL with no ?token=...: https://cdn.segmnt.cloud/e/{videoId}. See Protected and public videos. Protected is the default today; the rest of this page is about protected videos.

The call

POST /v1/projects/{projectId}/videos/{videoId}/playback-tokens
  • Auth: your project API key, Authorization: Bearer sk_....
  • Call it from your server, each time you show the video (or per page load).
  • The video must be ready and not held for review.
  • The domain must be a verified domain of the project.
Body: Answer (201):
Free and Starter play through our embed (our player, with our logo). Pro and Agency can use their own player. On a plan with white-label (Pro and Agency), the answer also has playlistUrl for your own hls.js player:
Put embedUrl in an iframe, or playlistUrl in your own player. See Embed a video on any website.

Bind a token to the viewer’s network (optional)

Status: Coming soon. See Feature status.
A project will be able to turn on network binding (ipBinding, off by default). Then each new token is bound to the viewer’s network, so a link that is shared to another network stops working. See Viewer network binding. You will pass the viewer’s IP address as viewerIp. Our API sees your server’s IP, not the viewer’s, so your server is the one that knows the viewer’s address: read it from the request socket or a trusted proxy header, and put it here. Send the viewer’s own address, never your server’s:
On a bound project a token will never be minted without it: a missing or invalid viewerIp will be 400 invalid_request. When ipBinding is off, viewerIp is ignored, so sending it is always safe. The setting applies to tokens you create after you change it; a token created earlier keeps working (or stays bound) until it expires. The CDN keeps only the viewer’s network prefix (IPv4 /24, IPv6 /64) and refuses another network with 403 ip_mismatch.

cURL

Node.js (18+)

PHP / Laravel

Keep services.segmnt.key in your server environment (.env), never in a Blade template or a page.

Put the token in the page

Build the iframe on your server and send only the finished HTML:
The page sees a token, never the key.

Errors

Errors use application/problem+json. Use the code field in your code, not the text.

Tested against the current release

Checked on 15 Oct 2026:
  • POST /v1/projects/{projectId}/videos/{videoId}/playback-tokens with no key → 401 unauthorized (the route is live).
  • The route, the verified-domain check, the token TTL and the held-video 409 are covered by our API tests.

Where to go next