Playground key
create a key →

API reference

Streams.

A stream is a robot's realtime room: up to eight cameras, the robot, and the people watching and driving it. These endpoints cover the full lifecycle: create, read, rename, choose what HLS records, rotate the device key, inspect session history, and delete. Every stream is scoped to the API key's organisation.

Stream object

json
{
  "id": "V1StGXR8_Z5jdHi6B-myT",
  "orgId": "…",
  "name": "Lobby rover",
  "slug": "lobby-rover",
  "status": "live",               // offline | live | ended
  "livekitRoomName": "dh_V1StGXR8_Z5jdHi6B-myT",
  "hlsPlaybackUrl": "https://…/live.m3u8",  // the main camera's
  "hls": "main",                  // off | main | all, see Cameras and HLS
  "cameras": [
    {
      "name": "main",
      "status": "live",           // live | offline
      "identity": "camera_V1StGXR8_Z5jdHi6B-myT",
      "recording": true,
      "hlsPlaybackUrl": "https://…/live.m3u8",
      "connectedAt": "2026-06-12T09:31:04.000Z",
      "disconnectedAt": null
    }
  ],
  "keyIssuedAt": "2026-06-12T09:30:00.000Z", // null for keys issued before Dec 2026
  "createdAt": "2026-06-12T09:30:00.000Z",
  "updatedAt": "2026-06-12T09:31:04.000Z"
}
The stream-key hash is never included in any API response.

Status

  • offline: created, not live yet.
  • live: a camera connected.
  • ended: the room closed after every participant left. A robot or viewer still connected keeps the stream live.

Cameras and HLS

A stream takes up to eight cameras; a ninth is refused. Each device exchanges the stream key with its own camera name (see device token exchange). A camera that gives no name is the main camera. cameras lists the cameras of the current or last session, main first.

hls decides which cameras are recorded to HLS: off, main (the default) or all. Each recorded camera has its own hlsPlaybackUrl: the live playlist while it publishes, and the full recording (index.m3u8) once the session ends. The stream's own hlsPlaybackUrl is the main camera's.

Each camera connection records its own playlist, so a URL changes when its camera reconnects or a new session starts. Earlier playlists aren't listed. A change to hls applies at once: cameras it no longer covers stop recording and their live playlist URLs are cleared (finished recordings keep theirs), and cameras it now covers start. Sending the same value again restarts any covered recording that isn't running.

HLS viewers are the CDN audience; WebRTC viewers see every camera whatever hls says. Each camera's name is in its participant metadata as camera.

List streams

Returns the organisation's streams, newest first, as { streams: [...] }. Each stream carries its cameras and its safety object.

GET/v1/streamsstreams:readTry it

Create a stream

Creates a stream and returns its one-time stream key alongside the object: { stream, streamKey }. The dh_sk_… key is shown only here — store it on the device now.

BodyTypeDescription
namerequiredstringDisplay name, 1–120 chars.
slugstringOptional URL slug (lowercase letters, numbers, dashes). Derived from name when omitted.
hlsstringoff, main (default) or all: which cameras are recorded to HLS.
POST/v1/streamsstreams:writeTry it

Get a stream

Full detail plus the current controller (or null): enough to render a complete stream page.

200 response
{
  "stream": { "id": "…", "status": "live", "hls": "main", "cameras": [ … ], … },
  "controller": {
    "identity": "operator-jane",
    "assignmentId": "…",
    "assignedBy": "api",
    "createdAt": "…"
  },
  "safety": {
    "estop": null,                // { at, reason, by } while an e-stop holds
    "controlTimeoutMs": null,
    "maxLagMs": null,
    "lastRevoke": { "identity": "…", "reason": "disconnected", "at": "…" }
  }
}
GET/v1/streams/:idstreams:readTry it

Update a stream

Updates the display name, what HLS records and the safety policy. Send only the fields you change; null turns a policy off.

BodyTypeDescription
namestringNew display name, 1–120 chars.
hlsstringoff, main or all. Applies to the cameras already live.
controlTimeoutMsinteger | null200–10000. Controller silence before robots stop and control is revoked.
maxLagMsinteger | null50–10000. Longest round trip robots drive with.
PATCH/v1/streams/:idstreams:writeTry it

Session history

One entry per live period, newest first. endedAt is null while a session is still live. egressId is the main camera's HLS recording job in progress, if any, and is usually cleared once that camera disconnects.

200 response
{
  "sessions": [
    { "id": "…", "startedAt": "…", "endedAt": "…", "egressId": "EG_…" }
  ]
}
GET/v1/streams/:id/sessionsstreams:readTry it

Rotate the stream key

Issues a fresh dh_sk_… key and invalidates the old one immediately — re-pair your devices afterwards. The new key is returned exactly once.

The previous key stops working the instant this returns; any camera/robot still using it will fail its next token exchange.
POST/v1/streams/:id/rotate-keystreams:writeTry it
destructive — changes real data

Delete a stream

Deletes the stream, its sessions and its controller history. Recordings already on the CDN stay at their URLs. Returns { ok: true }, or 404 if it doesn't exist in your org.

DELETE/v1/streams/:idstreams:writeTry it
destructive — changes real data