Skip to main content

Cli login

Generated from apiome-rest/openapi.yaml (API version 1.719.0) — do not edit by hand. How to authenticate is on the REST API reference.

Tag: cli-login · 6 operations

POST /v1/cli/login​

Start a CLI login

Starts apiome login. Returns a secret device_code for the CLI to poll with, a user_code to show the person, and the apiome-ui page where they approve it. The login expires after 10 minutes. No authentication; rate-limited per client IP.

Operation id: start_cli_login_v1_cli_login_post

Request body (optional)

Request body for start a cli login.

Responses

StatusDescriptionBody
201Successful response for start a cli login.application/json CliLoginStarted
422Validation Errorapplication/json HTTPValidationError

DELETE /v1/cli/login/key​

Revoke this CLI login key

Used by apiome logout: revokes the API key presented in X-API-Key, if apiome login created it. Any other key is refused with 409 — revoke it from the API Keys page.

Operation id: revoke_cli_login_key_v1_cli_login_key_delete

Parameters

NameInTypeRequiredDescription
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
204Successful response for revoke this cli login key.—
422Validation Errorapplication/json HTTPValidationError

GET /v1/cli/login/requests/{user_code}​

Read a pending CLI login

For the apiome-ui approve page: the pending login with this user code, and the signed-in person's workspaces with whether they may approve it there (api_keys:create). Requires a session token; 404 when no such login is waiting.

Operation id: read_cli_login_v1_cli_login_requests__user_code__get

Parameters

NameInTypeRequiredDescription
user_codepathstringyesPath parameter identifying the user code segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).

Responses

StatusDescriptionBody
200Successful response for read a pending cli login.application/json CliLoginRequestView
422Validation Errorapplication/json HTTPValidationError

POST /v1/cli/login/requests/{user_code}/approve​

Approve a CLI login

Approves the pending login for one workspace. The CLI's next poll then receives a 14-day API key for that workspace, created by you. Requires a session token and api_keys:create in the workspace. 404 when the login is no longer waiting.

Operation id: approve_cli_login_v1_cli_login_requests__user_code__approve_post

Parameters

NameInTypeRequiredDescription
user_codepathstringyesPath parameter identifying the user code segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).

Request body (required)

Request body for approve a cli login.

Responses

StatusDescriptionBody
200Successful response for approve a cli login.application/json CliLoginApproved
422Validation Errorapplication/json HTTPValidationError

POST /v1/cli/login/requests/{user_code}/deny​

Deny a CLI login

Refuses the pending login; the CLI stops with access_denied. Requires a session token. 404 when the login is no longer waiting.

Operation id: deny_cli_login_v1_cli_login_requests__user_code__deny_post

Parameters

NameInTypeRequiredDescription
user_codepathstringyesPath parameter identifying the user code segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).

Responses

StatusDescriptionBody
200Successful response for deny a cli login.application/json CliLoginApproved
422Validation Errorapplication/json HTTPValidationError

POST /v1/cli/login/token​

Collect a CLI login key

Polled by apiome login with its device_code. Until the login is approved this answers 400 with detail.error set to authorization_pending (keep polling), slow_down (polling faster than interval), access_denied, expired_token or invalid_grant. Once approved it mints a workspace API key for the approving user, valid for 14 days, and returns it once; the login is then used up.

Operation id: collect_cli_login_key_v1_cli_login_token_post

Request body (required)

Request body for collect a cli login key.

Responses

StatusDescriptionBody
200Successful response for collect a cli login key.application/json CliLoginKeyIssued
422Validation Errorapplication/json HTTPValidationError

Schemas used​

CliLoginApproveRequest​

Body of POST /v1/cli/login/requests/{user_code}/approve.

PropertyTypeRequiredDescription
tenant_slugstringyesURL-safe tenant slug used in path parameters.

CliLoginApproved​

The outcome of approving or denying a login.

PropertyTypeRequiredDescription
user_codestringyesUser Code.
statusstringyesStatus.
tenant_slugstring or nullnoURL-safe tenant slug used in path parameters.

CliLoginKeyIssued​

The key an approved login hands to the CLI — shown once.

PropertyTypeRequiredDescription
api_keystringyesThe secret. Send it as X-API-Key; it is never shown again.
key_idstringyesKey ID.
key_prefixstringyesKey Prefix.
key_namestringyesKey Name.
tenant_slugstringyesURL-safe tenant slug used in path parameters.
tenant_namestringyesTenant Name.
expires_atstring (date-time)yesExpires At timestamp (ISO 8601).

CliLoginRequestView​

What the approve page shows about a pending login.

PropertyTypeRequiredDescription
user_codestringyesUser Code.
client_namestring or nullnoClient Name.
statusstringyesStatus.
created_atstring (date-time)yesCreation timestamp (ISO 8601).
expires_atstring (date-time)yesExpires At timestamp (ISO 8601).
workspacesarray of CliLoginWorkspaceyesWorkspaces.

CliLoginStartRequest​

Body of POST /v1/cli/login.

PropertyTypeRequiredDescription
client_namestring or nullnoHow the CLI names itself on the approve page, e.g. apiome-cli on build-box.

CliLoginStarted​

A started login (RFC 8628 §3.2 device authorization response).

PropertyTypeRequiredDescription
device_codestringyesSecret the CLI polls with. Never show it to the person.
user_codestringyesCode the person compares in the browser, e.g. KTXR-MWDB.
verification_uristringyesThe approve page in apiome-ui.
verification_uri_completestringyesThe approve page with the code filled in.
expires_inintegeryesSeconds until the login expires.
intervalintegeryesSeconds to wait between polls.

CliLoginTokenRequest​

Body of POST /v1/cli/login/token.

PropertyTypeRequiredDescription
device_codestringyesDevice Code.

HTTPValidationError​

Validation error response emitted when request data fails schema checks.

PropertyTypeRequiredDescription
detailarray of ValidationErrornoDetail.