Begin a CLI login

Starts a device-authorization request. No authentication — the caller is a CLI that has no credential yet, which is the point of the flow; the route is rate-limited per IP instead.

Returns two codes with different jobs. The deviceCode is high-entropy, stays on the machine, and is the credential for POST /v1/device/poll. The userCode is short enough to read off a terminal and retype in a browser at verificationUri. Both die after expiresIn seconds.

Body
application/json
  • name
    Type: string

    Label for the machine logging in, shown to the person approving. Typically the hostname.

Responses
  • application/json
  • application/json
  • application/json
Request Example for post/v1/device/start
curl https://api.useportal.co/v1/device/start \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "rodrigo-macbook"
}'
{
  "deviceCode": "8f3c1d9e2b7a45f0a1c6e8d4b2f7093a5c1e6d8b4a2f7c093",
  "userCode": "K7WQ3MTD",
  "verificationUri": "https://app.useportal.co/authorize-cli",
  "interval": 5,
  "expiresIn": 600
}