Flow overview
The device code expires after 10 minutes. If not approved within that window, the next poll returnsDEVICE_CODE_EXPIRED.
POST /v1/cli/device/start
Start a new device authorization flow. Does not require anAuthorization header.
Request
Response
POST /v1/cli/device/complete
Called from the browser (by the Barekey web app) to approve a pending device code. Requires a valid Clerk session in the browser — this endpoint is not called directly by the CLI.Request
Response
Error codes
POST /v1/cli/device/poll
Poll for the status of a device authorization. Called by the CLI everyintervalSec seconds after starting the flow.
Request
Response — pending
Response — approved
On the first successful poll after the user approves in the browser, the response includes a token pair. Subsequent polls using the same device code will return an error (the code is markedexchanged).

