---
title: "Device Code Request"
method: POST
path: "/api/v1/auth/cli/device"
tags: ["authentication"]
---

# Device Code Request

`POST /api/v1/auth/cli/device`

## Request

- Base URL: `http://127.0.0.1:8052`
- URL: `http://127.0.0.1:8052/api/v1/auth/cli/device`
- Auth: none declared

Initiate device authorization flow for CLI login.

The CLI calls this to get a device_code and user_code.
The user enters the user_code in the web dashboard after SSO login
to authorize the CLI session.

## Request body

- DeviceCodeRequest: Body for POST /auth/cli/device - initiate device auth flow.
  - `client_name` string

## Response `200`

Successful Response

- DeviceCodeResponse: Response for device code request.
  - `device_code` string, required
  - `user_code` string, required
  - `verification_uri` string, required
  - `expires_in` integer, required
  - `interval` integer, required

## Other responses

- `404`: SSO authentication is not configured on this server
- `422`: Validation Error

---

[API](https://skmtc.dev/bernstein/apis/bernstein-task-server.md) · [All operations](https://skmtc.dev/bernstein/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc.dev/bernstein/apis/bernstein-task-server/revisions/2a20a34ad2eb?raw)
