DocsReferenceAPI reference
Pairing
A browser, or an agent on a new computer, gets the pairing key over Wi-Fi: the device screen shows a 4-digit code; click BOOT to allow, double-click to deny. Kernel only; in the rescue firmware use the key command over USB serial
POST /v1/pair#
Request pairing: the screen shows a 4-digit code; click BOOT to allow (30 s)
Open; no signing. Only one request can wait at a time. Then poll GET /v1/pair?id=; you get the device's existing key, which is generated only if there is none
Request body#
application/json
Pairing request
| Field | Type | Required | Values | Range | Description |
|---|---|---|---|---|---|
name | string | Yes | pattern ^[^\u0000-\u001f\u007f]+$ | length 1–32; ≤ 32 bytes | Requester name shown on the device screen; 1–32 bytes, no control characters |
Examples#
Browser#
{"name": "Chrome · Windows"}Agent#
{"name": "Claude Code"}Reply#
The request is on the screen
The pairing request is shown on the device screen
| Field | Type | Required | Values | Range | Description |
|---|---|---|---|---|---|
ok | boolean | Yes | true | Always true | |
id | string | Yes | pattern ^[0-9a-f]{16}$ | Request ID for checking the result | |
code | string | Yes | pattern ^[0-9]{4}$ | 4-digit code shown on the screen for the person to compare | |
expires_s | integer | Yes | ≥ 1 | Seconds left to press BOOT |
Error codes#
| Status | Code | Description |
|---|---|---|
400 | bad_args | name must be 1–32 bytes with no control characters. See the example “Browser” for the correct form |
409 | busy | Another request is waiting: let it expire (30 s), or double-click BOOT to deny it, then retry |
For errors any endpoint can return, see Common errors.
GET /v1/pair#
Pairing result; the first query after approval includes the key
Open. Poll about once a second. The key is given once and the id then becomes invalid; 30 s after the outcome, or once a new request replaces it, queries return 404
Parameters#
| Parameter | Type | Required | Values | Range | Description |
|---|---|---|---|---|---|
id | string | Yes | pattern ^[0-9a-f]{16}$ | id returned by POST /v1/pair |
Reply#
Pairing result
| Field | Type | Required | Values | Range | Description |
|---|---|---|---|---|---|
ok | boolean | Yes | true | Always true | |
state | string | Yes | waiting approved denied expired | waiting = waiting for a press, approved, denied, expired | |
left_s | integer | ≥ 0 | Seconds left while waiting | ||
key | string | pattern ^[0-9a-f]{64}$ | Pairing key (64 hex digits), only when approved and only this once |
Error codes#
| Status | Code | Description |
|---|---|---|
400 | bad_args | id is missing or not 16 characters |
404 | not_found | No such request: the key was already taken, a new request replaced it, or the outcome is over 30 s old. POST /v1/pair again |
500 | nvs | Saving the new key failed. Retry |
For errors any endpoint can return, see Common errors.