https://api.segmnt.cloud
This reference covers 42 public endpoints across 33 paths. Every public
endpoint has an entry in the sidebar, with its request and response shapes.
Authentication
There are two ways to authenticate.
Rules:
- Keep the API key on your server. It can create playback tokens, so anyone with it can play your videos anywhere. Never put a key in a page, a browser or a mobile app.
- A key works only for its own project’s routes. A key from another project
answers
404. - A revoked key answers
401immediately. - Account routes (projects, API keys, domains, billing) accept only the session. An API key cannot manage keys, projects or domains.
- A key has a scope:
full(every route of its project) orplayback(only the playback-token route). See Accounts, projects, API keys and domains. - Sign-in is SSO only: Google and GitHub. We never store a password.
Conventions
- IDs are strings with a type prefix:
acc_,usr_,prj_,vid_,upl_,utk_,key_,dom_,whe_,evt_,rep_. - Times are RFC 3339 in UTC.
- Pagination is by cursor. Pass the
nextCursorfrom an answer back ascursorto get the next page. - Errors are
application/problem+jsonwith a stablecode. See Errors. Idempotency-Keyis scoped to the project. Only upload create and video reports read it. The same key returns the first result. We do not compare the body, so use a new key for a new request.- Money is an integer in the smallest currency unit (halalas for SAR; 1 SAR = 100 halalas).
- Send bodies as
application/json. A body that is not valid JSON gets400.
Rate limits
Over a limit you get
429 with Retry-After. See Errors.
The public endpoints
System and auth
Projects, keys and domains
Uploads and videos
To upload a video, see Direct upload. To rename it or delete
it, see Manage videos. To let a browser upload on your own
domain, see the browser upload token in Direct upload.
Webhooks, usage and billing
For the events we send, the payload, and how to checkSegmnt-Signature, see
Webhooks.
Where to go next
- Quickstart — the end-to-end path, from upload to a
403off-domain. - Manage videos — rename or delete a video.
- Webhooks — get a signed event when a video changes.
- Errors — every code, with the
403and409causes. - Changelog — what changed and when.
- Glossary — the words used here.