---
title: "Start OAuth device authorization."
method: POST
path: "/oauth/device/code"
tags: ["Authentication"]
---

# Start OAuth device authorization.

`POST /oauth/device/code`

## Request

- Base URL: `https://commentary.dev`
- URL: `https://commentary.dev/oauth/device/code`
- Auth: none declared

Scope-less requests for the canonical /mcp resource defer permission selection to the signed-in device consent page; other omitted-scope requests stay read-only.

## Request body

- object
  - `client_id` string, required
  - `scope` string
  - `target` string: Target string such as account, github:owner/repo, github:owner/repo:pull:123, github:owner/repo:branch:main, or draft:sessionId.
  - `resource` string
  - `client_name` string

## Response `200`

Successful response.

- object
  - `device_code` string
  - `user_code` string
  - `verification_uri` string, uri
  - `verification_uri_complete` string, uri
  - `expires_in` integer
  - `interval` integer

## Other responses

- `400`: OAuth request error.
- `429`: The request was rate limited.

---

[API](https://skmtc.dev/commentary/apis/commentary-public-api.md) · [All operations](https://skmtc.dev/commentary/apis/commentary-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/commentary/apis/commentary-public-api/revisions/7aaafc198c52?raw)
