The CLI uses a device authorization flow so local machines can receive a scoped API key without pasting one manually.

Create a code

Create device code
POST /v1/device/code
Auth: No API keyRate limit: IP limited

Creates a human-readable code and polling token.

201
json
{ "user_code": "ABCD-2345", "poll_token": "64_hex_characters", "verification_uri": "https://screenframed.com/device", "verification_uri_complete": "https://screenframed.com/device?code=ABCD-2345", "expires_in": 900, "interval": 5}

Poll for token

Poll device token
POST /v1/device/token
Auth: No API keyRate limit: Token limited

Polls until the browser authorization completes or the code expires.

bash
curl -X POST "https://screenframed.com/v1/device/token" \ -H "Content-Type: application/json" \ -d '{ "poll_token": "64_hex_characters" }'

Pending response:

json
{ "status": "pending", "interval": 5, "expires_in": 840}

Authorized response:

json
{ "status": "authorized", "api_key": "sf_live_...", "key_id": "01K...", "user_id": "..."}

Most users should use screenframed login rather than calling these endpoints directly.

Ask a question... ⌘I