---
title: Begin the CLI device-authorization flow
description: Public.
api_method: POST
api_path: "/v1/auth/cli/start"
canonical_url: https://wiblo.app/docs/developers/api/cli/start-cli-device-flow
last_updated: 2026-07-28T17:31:44+02:00
md_url: https://wiblo.app/docs/developers/api/cli/start-cli-device-flow.md
---

# Begin the CLI device-authorization flow

`POST /v1/auth/cli/start`

Public. The CLI requests a `device_code` + human-typeable `user_code` and the verification URLs (RFC 8628). `scopes` must be empty in v1; a non-empty array is rejected. An unknown `client_id` is rejected with `BAD_REQUEST`. Rate-limited per IP at 15/10min.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `client_id` | `string` | Yes |  |
| `scopes` | `array<string>` | No | Defaults to `[]`. |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/auth/cli/start \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "..."
}'
```

**TypeScript**

```ts
import { createSdk, startCliDeviceFlow } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await startCliDeviceFlow({
  client: sdk,
  body: {
    "client_id": "..."
  },
})
```

## Responses

**`200`** — Device + user codes and the verification URLs. Returns `StartDeviceFlowResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `device_code` | `string` | Yes |  |
| `user_code` | `string` | Yes |  |
| `verification_uri` | `string` | Yes |  |
| `verification_uri_complete` | `string` | Yes |  |
| `expires_in` | `integer` | Yes |  |
| `interval` | `integer` | Yes |  |

**`400`** — Unknown `client_id` (`BAD_REQUEST`) or body failed Zod validation, e.g. a non-empty `scopes` array (`VALIDATION_FAILED`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.
