Menu QaldyDocs

Device login (command line)

The routes behind qaldy login: a terminal asks for a code, a person approves it in the console. 5 routes, from the API’s own OpenAPI document.

5 routes. Every path starts at https://cloud-api.qaldy.com. Sign-in, tokens, errors and limits are on the overview.

Routes

MethodPathWhat it does
POST/​v1/​cli/​deviceStart a CLI sign-in: a device code to poll with and a user code to show (no sign-in)
GET/​v1/​cli/​device/​{userCode}What a waiting CLI sign-in asks for, and where you may approve it (console)
POST/​v1/​cli/​device/​{userCode}/​approveApprove a CLI sign-in for one workspace, with at most the scopes it asked for (console)
POST/​v1/​cli/​device/​{userCode}/​denyRefuse a CLI sign-in (console)
POST/​v1/​cli/​device/​pollAsk whether a CLI sign-in was approved; the token comes back once (no sign-in)

Reference

POST /v1/cli/device

Start a CLI sign-in: a device code to poll with and a user code to show (no sign-in).

  • Authentication: the console’s session cookie.
  • Token: not available. This route is for a signed-in person in the console (403 console_only for a token).
  • Who: public: a terminal has no sign-in yet; rate-limited, at most 2,000 logins open at once

Request body (application/json)

FieldTypeRequiredNotes
clientstringyes
purpose"login" · "token"default "login"
namestring1 to 60 characters
scopes"read" · "write"[]up to 2 items. default read,write
expiresInDaysinteger1 to 365. default 90
hoststring1 to 64 characters

Response 200

FieldTypeRequiredNotes
deviceCodestringyes
userCodestringyes
verificationUristring (uri)yes
verificationUriCompletestring (uri)yes
expiresInintegeryesat least 1
intervalintegeryesat least 1

Errors: 400, 401, 403, 404, 409, 429 (the error format is on the overview).

GET /v1/cli/device/{userCode}

What a waiting CLI sign-in asks for, and where you may approve it (console).

  • Authentication: the console’s session cookie.
  • Token: not available. This route is for a signed-in person in the console (403 console_only for a token).
  • Who: signed in (a token gets console_only)
ParameterInTypeRequiredNotes
userCodepathstringyes1 to 32 characters

Response 200

FieldTypeRequiredNotes
userCodestringyes
clientstringyesat least 1 characters
purpose"login" · "token"yes
namestringyes1 to 60 characters
scopes"read" · "write"[]yesup to 2 items
expiresInDaysintegeryes1 to 365
hoststring or nullyes
status"pending" · "approved" · "denied" · "expired"yes
createdAtstringyesat least 1 characters
expiresAtstringyesat least 1 characters
workspacesobject[]yes
workspaces[].idstringyesat least 1 characters
workspaces[].namestringyesat least 1 characters
workspaces[].slugstringyesat least 1 characters
workspaces[].role"owner" · "admin" · "builder" · "member" · "viewer"yes

Errors: 400, 401, 403, 404, 409, 429 (the error format is on the overview).

POST /v1/cli/device/{userCode}/approve

Approve a CLI sign-in for one workspace, with at most the scopes it asked for (console).

  • Authentication: the console’s session cookie.
  • Token: not available. This route is for a signed-in person in the console (403 console_only for a token).
  • Who: workspace member, in the console only; admin tokens are never made this way
ParameterInTypeRequiredNotes
userCodepathstringyes1 to 32 characters

Request body (application/json)

FieldTypeRequiredNotes
workspaceIdstringyes1 to 128 characters
scopes"read" · "write"[]yesup to 2 items
expiresInDaysintegeryes1 to 365

Response 200

FieldTypeRequiredNotes
userCodestringyes
status"approved" · "denied"yes

Errors: 400, 401, 403, 404, 409, 429 (the error format is on the overview).

POST /v1/cli/device/{userCode}/deny

Refuse a CLI sign-in (console).

  • Authentication: the console’s session cookie.
  • Token: not available. This route is for a signed-in person in the console (403 console_only for a token).
  • Who: signed in
ParameterInTypeRequiredNotes
userCodepathstringyes1 to 32 characters

Response 200

FieldTypeRequiredNotes
userCodestringyes
status"approved" · "denied"yes

Errors: 400, 401, 403, 404, 409, 429 (the error format is on the overview).

POST /v1/cli/device/poll

Ask whether a CLI sign-in was approved; the token comes back once (no sign-in).

  • Authentication: the console’s session cookie.
  • Token: not available. This route is for a signed-in person in the console (403 console_only for a token).
  • Who: public: the device code is the proof

Request body (application/json)

FieldTypeRequiredNotes
deviceCodestringyes

Response 200

A object.

Errors: 400, 401, 403, 404, 409, 429 (the error format is on the overview).

Type to search. Up and down to choose, Enter to open, Esc to close.