Skip to Content
Workspace and account

CLI login

The Kenso CLI's browser login: start a login, then poll it until it hands the CLI an API key.

Workspace and account2 endpointsKen-Version: 2026-11-02AuthenticationWorkspacesErrors
MarkdownOpenAPI

Headers

The endpoints on this page take these headers. Each endpoint's curl shows the ones it sends.

NameInTypeRequiredDescription
Ken-Versionheaderstring, one of: 2026-11-02, 1.1optionalThe API version, a date in YYYY-MM-DD form. 1.1 is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and 404 where the path exists only in this version. A date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy.

Start a CLI login

POST/v1/cli/loginscli-logins.create
Permission
None: no API key needed
Rate limit
10 requests a minute and 60 an hour per IP address

Try it on developer.ken.so

Starts a browser login for the Kenso CLI. Show the person userCode and open verificationUrl, where they approve the login while signed in to Kenso. Then call POST /v1/cli/logins/token with loginId every interval seconds, until it returns the API key or the login expires after expiresIn seconds.

deviceName is required, from 1 to 100 characters. The approval page shows it, and the new API key's name includes it. Keep loginId private: whoever holds it can pick up the key.

Errors:

  • 400 validation_failed: deviceName is missing, empty or longer than 100 characters.
  • 429 quota_exceeded: too many logins started from this IP address. Wait for the seconds in Retry-After.
  • 503 service_unavailable: Kenso could not start the login. Try again in a minute.

Needs no credential.

Request body

application/json, optional.

FieldTypeRequiredDescription
deviceNamestringrequiredRequired. A name for the machine the CLI runs on, from 1 to 100 characters. The approval page shows it, and the new API key's name includes it.
Request
curl -X POST "https://api.ken.so/v1/cli/logins" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "Content-Type: application/json" \
  -d '{
  "deviceName": "string"
}'

Response 201

data is a CliLoginCreated.

Show the 5 response fields and an example

The fields and an example are also on this endpoint's Markdown page.

Poll a CLI login for its API key

POST/v1/cli/logins/tokencli-logins.token
Permission
None: no API key needed
Rate limit
120 requests a minute per IP address

Try it on developer.ken.so

Checks a login started with POST /v1/cli/logins. Once the person approves it, the call returns the new apiKey with its apiKeyId, the workspace they picked, their email and the key's expiresAt. Kenso returns the key once and then deletes the login, so store the key right away.

The key belongs to the person who approved the login. It reaches every workspace they are a member of, with their own permissions there. workspaceId is only the default workspace for the CLI.

Until then, the call answers 400 with one of these codes:

  • authorization_pending: the person has not approved the login yet. Poll again after interval seconds.
  • slow_down: the poll came sooner than interval seconds after the last one. Wait longer.
  • access_denied: the person denied the login. Stop polling.
  • expired_token: the login expired, was already picked up, or never existed. Start a new login.

Errors:

  • 400 validation_failed: loginId is missing.
  • 429 quota_exceeded: too many polls from this IP address. Wait for the seconds in Retry-After.
  • 503 service_unavailable: Kenso could not read the login. Poll again.

Needs no credential: loginId is the secret.

Request body

application/json, optional.

FieldTypeRequiredDescription
loginIdstringrequiredRequired. The loginId that POST /v1/cli/logins returned.
Request
curl -X POST "https://api.ken.so/v1/cli/logins/token" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "Content-Type: application/json" \
  -d '{
  "loginId": "string"
}'

Response 200

data is a CliLoginToken.

Show the 5 response fields and an example

The fields and an example are also on this endpoint's Markdown page.


On this page