AppAIGatewayDocs

Ask a person to log this CLI in

POST
/v1/cli/login

Persist the random token before sending: its digest is the operation's id, and sending it again answers with where the login stands — completed once approved, when polling or redeeming collects the key — and never hands the key over itself. Needs no credential. Open url in a browser, or show userCode for the person to type on the console's code-entry page; once a signed-in person approves, the CLI receives a management key of its own in the account they chose. Without loopbackRedirect, poll pollCliOperation until it completes: the first completed answer carries the key in result.credential, and no later one does. With loopbackRedirect, the approval page sends the browser there with a one-time code, which redeemCliLogin exchanges for the key; polling then never returns it. A login expires after 15 minutes, and its record is kept for a day. Each network address may ask for 20 logins an hour — sending the same token again is not counted — and may have 10 waiting at once.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/cli/login" \  -H "Content-Type: application/json" \  -d '{    "token": "string",    "client": {      "label": "string"    }  }'
{  "id": "string",  "kind": "login",  "state": "pending",  "url": "http://example.com",  "userCode": "string",  "expiresAt": "string"}