Control API
Every route of the Nearglass control API at https://api.nearglass.com, generated from its OpenAPI file.
Keys go in Authorization: Bearer <key>. Request bodies are JSON.
Streams
| Method and path | Key | What |
|---|---|---|
GET /v1/streams | sk_... | List streams |
POST /v1/streams | sk_... | Create a stream |
GET /v1/streams/{id} | sk_... | Read a stream |
DELETE /v1/streams/{id} | sk_... | Delete a stream |
PATCH /v1/streams/{id} | sk_... | Change a stream's name, seats, line or admission |
POST /v1/streams/{id}/stream-key | sk_... | Rotate the stream key |
GET /v1/streams/{id}/stats | sk_... | Seats, line and turns now |
Tokens
| Method and path | Key | What |
|---|---|---|
POST /v1/streams/{id}/publisher-tokens | sk_... | A token for an SDK publisher (nearglass-pub, nearglass.h) |
POST /v1/streams/{id}/viewer-tokens | sk_... | A seat and its viewer token (server admission), or a place in line |
POST /v1/streams/{id}/controller-tokens | sk_... | A driver's turn (interactive streams) |
DELETE /v1/streams/{id}/controller-tokens/{turn_id} | sk_... | End a turn |
Admission
| Method and path | Key | What |
|---|---|---|
DELETE /v1/streams/{id}/viewers/{seat} | sk_... | Kick a viewer |
POST /v1/play/{id}/admit | pk_... | The public waiting room (a page, publishable key) |
POST /v1/play/{id}/token | none | A fresh viewer token for a seated page (a reconnect) |
POST /v1/play/{id}/hb | none | Keep the seat (every 5 s; a hidden tab as often as the browser lets it) |
POST /v1/play/{id}/leave | none | Give the seat (or the place in line) up now |
GET /v1/play/{id}/hls/{file} | none | The stream's LL-HLS, for a held seat |
Tenants
| Method and path | Key | What |
|---|---|---|
POST /v1/tenant/secret-keys | sk_... | A new secret key for your tenant (at most 4; revoke_others rotates) |
POST /v1/tenant/publishable-keys | sk_... | A new publishable key for your tenant (at most 4; revoke_others rotates) |
GET /v1/tenant | sk_... | Your tenant (limits, relay scope, public key, this month's spend) |
PATCH /v1/tenant | sk_... | Set your monthly spending cap or webhook |
Usage
| Method and path | Key | What |
|---|---|---|
GET /v1/usage | sk_... | Viewer-hours and bytes per day and per stream, and this month's spend |
Fleet
| Method and path | Key | What |
|---|---|---|
GET /v1/status | none | The public status, as JSON |
GET /status | none | The public status page (HTML, refreshed from /v1/status every 5 s) |
Service
| Method and path | Key | What |
|---|---|---|
GET /v1/health | none | Liveness |
GET /v1/issuer | none | The token issuer's public key, for the relay's scope config |