Request Device Code
POST
Start the device authorization flow. The CLI or MCP server calls this endpoint to get a device code and user code.
No authentication required. This is a public endpoint.
Flow
- Client calls this endpoint to get codes
- User visits the
verification_uriand enters theuser_code - Client polls
/v1/auth/device/tokenuntil user approves
XXXX-XXXX with an unambiguous alphabet (no 0/O, 1/I/l confusion).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
client_id | string | Yes | Client identifier: dealmachine-next-cli or dealmachine-next-mcp |
device_name | string | No | Friendly name for the device (e.g., “MacBook Pro”) |
Response Fields
| Field | Type | Description |
|---|---|---|
device_code | string | Secret code for polling (don’t show to user) |
user_code | string | Code for user to enter (XXXX-XXXX format) |
verification_uri | string | URL for user to visit |
verification_uri_complete | string | URL with code pre-filled |
expires_in | number | Seconds until codes expire (30 days) |
interval | number | Minimum seconds between poll requests |