---
title: "Start CLI browser login"
method: POST
path: "/cli/login/start"
tags: ["CLI"]
---

# Start CLI browser login

`POST /cli/login/start`

Starts a browser-assisted CLI login session. The response includes a
device code for polling and a user code that the user approves in the
browser. This endpoint does not require an API key.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `device_name` string — Human-readable device name shown during browser approval
  - `metadata` object — Optional client metadata stored with the login session; serialized JSON must be 2048 bytes or fewer

## Response `201`

CLI login session created

- object
  - `success` true, required
  - `data` object, required
    - `device_code` string, required — Opaque code used by the CLI to poll for approval
    - `user_code` string, required — Short code the user confirms in the browser
    - `verification_uri` string, required — Browser URL where the user approves the login
    - `verification_uri_complete` string, required — Browser URL with the user code prefilled
    - `expires_in` integer, required — Seconds until the login session expires
    - `interval` integer, required — Minimum seconds between poll requests

## Other responses

- `400` — Invalid request parameters
- `429` — Rate limit exceeded

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) · [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primitive/primitive-api/revisions/c2299d28022c/schema)
