Playground key
create a key →

API reference

Control.

At most one of your end-users can drive a stream at a time — the single-controller invariant, enforced at the media server, not in client code. These two endpoints are how your backend says who that is. Assigning a new controller revokes the previous one instantly, mid-session, with no cooperation from the old client.

Assign the controller

Make identity the one controller of the stream. If that participant is already connected (as a viewer), their permissions upgrade live — no reconnect. The previous controller, if any, is demoted to watch-only in the same call. While the stream is e-stopped this returns 409 estopped.

BodyTypeDescription
identityrequiredstringThe participant identity to promote — the same identity you used when minting that user's access token.
201 response
{
  "assignment": {
    "id": "…",
    "streamId": "…",
    "identity": "operator-jane",
    "assignedBy": "api",
    "active": true,
    "createdAt": "2026-06-12T09:30:00.000Z",
    "revokedAt": null
  }
}
POST/v1/streams/:id/controllercontroller:writeTry it

Revoke the controller

Removes control entirely — nobody can drive until you assign again. Pass ?identity= to revoke only while that identity holds control, so a late revoke can't strip someone assigned since. Returns { revoked: { identity } }, or 404 when no controller is currently assigned.

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

The control model

Assignment is the source of truth, not the token

A controller token only carries control if its identity is the currently assigned controller. The usual flow is: mint everyone a viewer token, then promote one identity here — connected viewers upgrade live. Minting a controller token for an identity that isn't assigned yet returns 409 controller_not_assigned. See Access tokens and the control-queue recipe.

Both assignment and revocation emit a webhook (controller.assigned / controller.revoked) so other services can react — see Webhooks.

Control follows the connection

  • The assigned identity gets control whenever it joins, with a viewer or a controller token. Assigning before the user connects works: control arrives with them.
  • A page reload or a reconnect with the same identity keeps control, as long as nothing else took it meanwhile.
  • When the controller's connection ends for good, control is revoked with reason disconnected.

What the guarantee covers

  • Exactly one of your end-users holds control, even when assignments race: the last one wins and the others lose data permission.
  • Tokens never carry control themselves, so a token kept after a revoke can't take it back.
  • Camera and robot tokens can send data too. Robots should act only on the controller named in the room state; see Safety.
  • While an e-stop holds, nobody can be given control and only robots can send data.