VarisDocs
Dashboard

Start a CLI sign-in

POST/v1/cli/device/code

Starts varis login. Returns a device code for the CLI to poll with, a user code for the developer to enter at verification_uri, and how often to poll.

The device code is a secret and this is its only copy. Varis stores its hash. The handshake expires after expires_in seconds, 10 minutes, whether or not anyone approves it.

Unauthenticated, because the developer has no token yet, so limited per IP address.

Body

application/json
device_namestringrequired

This machine's name, usually its hostname. Shown on the approval page so the developer can tell their own machine from a sign-in they did not start, and kept on the device token to list signed-in machines. Surrounding whitespace is trimmed, and a name over 128 characters is truncated rather than rejected.

Response

application/json

The sign-in has started. Show the user code and poll.

device_codestringrequired

Secret. Send it to the token endpoint on every poll. Never show it to the developer or log it.

user_codestringrequired

What the developer enters on the approval page. Eight characters from RFC 8628's base-20 alphabet, with a dash for reading. Matching ignores case and punctuation.

verification_uristring<uri>required

The approval page. Print it with the user code.

verification_uri_completestring<uri>required

The approval page with the user code filled in. Open it in a browser when one is available.

expires_inintegerrequired

Seconds until the device code and user code stop working.

intervalintegerrequired

Seconds to wait between polls. Grows by 5 each time the token endpoint answers slow_down.

request_idstringrequired
curl -X POST 'https://api.usevaris.com/v1/cli/device/code' \  -H 'Content-Type: application/json' \  -d '{  "device_name": "string"}'
{  "device_code": "string",  "user_code": "string",  "verification_uri": "http://example.com",  "verification_uri_complete": "http://example.com",  "expires_in": 0,  "interval": 0,  "request_id": "string"}