# API reference: live-control

Live control of a robot: real motion from code, a policy or teleoperation. An agent or a key may ask. A signed-in person arms it for a window, in teach or full mode. The bridge on the robot's computer verifies the grant offline and enforces the limits the person read.

## GET /v1/devices/{device_id}/live-control

`listLiveControl` · scope `key:read` · List a device's live-control requests and grants

Newest first. `-` as the device lists every device you can see. `status` narrows the list. An issued or armed grant past its `expires_at` reads as `expired`, and `status=issued` lists only grants still inside their window. The bridge on the robot's computer polls `status=issued` and verifies each token offline before it arms.

Parameters:

- `device_id` (path, required): Device id (`dev_...`). `listApprovals` and `listLiveControl` also take `-`, every device you can see.
- `status` (query)
- `limit` (query): Page size.
- `cursor` (query): Opaque cursor from the previous page's `next_cursor`.

Responses:

- `200`: Page of live-control requests.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## POST /v1/devices/{device_id}/live-control

`requestLiveControl` · scope `key:write` · Ask a person to arm live control of a robot

Files a request to arm one robot on this device for live control: real motion driven by code, a policy or teleoperation. **A request arms nothing.** A signed-in person decides it on the consent page (`grantLiveControl`). No API key can grant one.

The robot is the device's robot (its card must declare an `interface`, else `422`). `robot_name` is the robot's name in the bridge's own configuration on the robot's computer. `mode` is `teach` (reduced speed, the default) or `full` (the declared limits). `minutes` is the window, 1 to 60, 10 by default. The answer carries the limits table the person will read. `404` for a device you cannot see, `409` when it was disconnected. Audited as `device.live_request`.

Parameters:

- `device_id` (path, required): Device id (`dev_...`). `listApprovals` and `listLiveControl` also take `-`, every device you can see.

Request body: `application/json`, required.

Responses:

- `201`: The pending request, with the limits a person will read.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## GET /v1/live-control/{grant_id}

`getLiveControl` · scope `key:read` · Get a live-control request by its id

What the consent page shows: the robot and what can move on it, the mode, the limits table, the window, and who asked. After the decision the same id is the record: who decided, when the bridge armed, when and why it ended. A request on a device you cannot see is `404`.

Parameters:

- `grant_id` (path, required): Live-control request id (`lcg_...`).

Responses:

- `200`: The request or grant.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## POST /v1/live-control/{grant_id}/grant

`grantLiveControl` · scope `session` · Arm live control (web session only)

**`session` scope: a person signed in to the web app. No API key of any scope can call this.** Approving a pending request mints an EdDSA (Ed25519) token. It is bound to the device (`sub`), the robot, its name on the bridge, the mode, the interface fingerprint and the limits table's digest, with `exp = now + minutes`. The bridge verifies it offline against the key it pinned and arms the robot until `exp`.

The person may shorten the window or lower `full` to `teach`. A longer window or a wider mode is `422`. There is no way to extend a grant: a longer session is a new request. `safety_acknowledged` must be true (`422` otherwise). `409` when the request is not pending or the device was disconnected. Where an organization requires a second person, the person who asked cannot grant (`403`). Audited as `device.live_armed`.

Parameters:

- `grant_id` (path, required): Live-control request id (`lcg_...`).

Request body: `application/json`, required.

Responses:

- `200`: The issued grant.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## POST /v1/live-control/{grant_id}/deny

`denyLiveControl` · scope `session` · Deny a live-control request (web session only)

**`session` scope.** A person declines a pending request, with a reason the asker reads. `409` when it is not pending. Audited as `device.live_ended` with the reason `denied`.

Parameters:

- `grant_id` (path, required): Live-control request id (`lcg_...`).

Request body: `application/json`, required.

Responses:

- `200`: The denied request.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## POST /v1/live-control/{grant_id}/stop

`stopLiveControl` · scope `key:read` · Stop a live session from the hub

**`key:read` scope: anyone who can see the device may stop it.** A person on the web page, a key or an agent. A stop only reduces what can move, which is why it needs no more than read. An issued grant ends at once. An armed one keeps its status until the bridge confirms. The bridge listens for stops (`listLiveControlStops`) and acts on every one it receives: it latches its e-stop and ends the session. It takes no motion or limits this way. `409` when the grant already ended. Audited as `device.live_ended` with the reason `stopped`.

Parameters:

- `grant_id` (path, required): Live-control request id (`lcg_...`).

Responses:

- `200`: The grant, with `stop_requested_at` set.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

## GET /v1/devices/{device_id}/live-control/stops

`listLiveControlStops` · scope `key:read` · Wait for a stop from the hub

The bridge holds this open. It answers at once when a person asked to stop a grant on this device that is still inside its window, and the bridge has not confirmed it yet. Otherwise it waits up to `wait` seconds (at most 30) and answers with an empty list.

Parameters:

- `device_id` (path, required): Device id (`dev_...`). `listApprovals` and `listLiveControl` also take `-`, every device you can see.
- `wait` (query)

Responses:

- `200`: The stops to act on.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## POST /v1/live-control/{grant_id}/report

`reportLiveControl` · scope `key:write` · The bridge reports that it armed, refused or ended a grant

Signed by the device's own key over the canonical JSON of `{grant_id, device_id, kind, reason, ts}`, verified against the key the device registered (`422` otherwise). `armed` moves an issued grant to armed. `refused` and `ended` end it, with the bridge's reason: `expired`, `e_stop`, `hub_stop`, `bridge_stop`, `bridge_restart`, `disarmed`, or the offline check that failed. `ended` with `hub_stop` confirms a stop from the hub, also on a grant that already ended. A report changes only this grant's record. `409` for a transition the grant cannot make. `ended` and `refused` are audited as `device.live_ended`.

Parameters:

- `grant_id` (path, required): Live-control request id (`lcg_...`).

Request body: `application/json`, required.

Responses:

- `200`: The grant after the report.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.
