---
title: "Request Device Code"
method: POST
path: "/oauth/device/code"
---

# Request Device Code

`POST /oauth/device/code`

## Request

- Base URL: `https://api.dashboard.knotapi.com`
- URL: `https://api.dashboard.knotapi.com/oauth/device/code`
- Auth: none required

Request a device code to start the device authorization flow.

## Request body `application/x-www-form-urlencoded`

- object
  - `client_id` string, required: Your client ID for the environment you want to manage, found in the Knot Dashboard. Never send your secret.
  - `scope` string, required: Space-delimited list of [scopes](/api-reference/agent-authorization/overview#scopes) to request. At least one is required.

## Response `200`

Successful request.

- object
  - `device_code` string: Code to exchange for an access token. Do not show it to the user.
  - `user_code` string: Code for the user to enter in the Knot Dashboard. Eight letters; a hyphen is optional.
  - `verification_uri` string: URL where the user approves the request.
  - `verification_uri_complete` string: The `verification_uri` with the `user_code`. The approval page still asks the user to enter the code.
  - `expires_in` integer: Seconds until the `device_code` and `user_code` expire.
  - `interval` integer: Minimum seconds to wait between polling requests.

## Other responses

- `400`: Bad request.
- `401`: Unauthorized request.
- `500`: Internal server error.

## Changes

- **2026-11-03** `f10ecfa12c00`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/knotapi/apis/knot-api/changes/oauth/device/code/post.md)

---

[API](https://skmtc.dev/knotapi/apis/knot-api.md) - [All operations](https://skmtc.dev/knotapi/apis/knot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/knotapi/apis/knot-api/revisions/f10ecfa12c00?raw)
