Skip to main content

Devices API

Manage device pairing for your agent. Devices can be self-paired (auto-approved) or created via a pairing code flow where they start in a pending state and can be approved, denied, or revoked.
All device endpoints require an authenticated session. Unauthenticated requests receive a 401 response.

List devices

Returns all pending and approved devices grouped by status.

Response

Device object

Errors


Generate a pairing code

Creates a new device in pending status and returns a pairing code. Use this when you want another device to complete the pairing flow via a code or URL.

Query parameters

Response

Example

Errors


Self-pair a device

Pairs the current device directly with auto-approval. This is used for self-pairing flows such as the “Pair My iPhone” button, where the requesting device is the one being paired.

Request body

Response

Example

Errors


Manage a device

Approve, deny, or revoke a device. The action must be valid for the device’s current status:
  • approve — only valid when the device is pending
  • deny — only valid when the device is pending
  • revoke — only valid when the device is approved

Request body

Response

Errors

Example: approve a device

Example: revoke a device


OpenClaw devices proxy (deprecated)

These proxy endpoints are deprecated and will be removed in a future release. Device management now uses the local endpoints documented above (/api/devices and /api/devices/pair) instead of proxying to the agent runtime.
The following endpoints previously proxied device management requests to the agent’s OpenClaw runtime. They have been replaced by the local device pairing API.

List paired devices (runtime)

Returns the list of devices paired with the agent’s runtime. Proxies to the agent’s GET /api/devices endpoint.

Errors

Manage paired devices (runtime)

Perform device actions on the agent’s runtime. The action field determines the behavior.

Request body

Actions

Example: pair a new device

Example: unpair a device

Example: test push notification

Errors