Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Request Device Code

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

  1. Client calls this endpoint to get codes
  2. User visits the verification_uri and enters the user_code
  3. Client polls /v1/auth/device/token until user approves
User codes use the format XXXX-XXXX with an unambiguous alphabet (no 0/O, 1/I/l confusion).

Request Body

FieldTypeRequiredDescription
client_idstringYesClient identifier: dealmachine-next-cli or dealmachine-next-mcp
device_namestringNoFriendly name for the device (e.g., "MacBook Pro")

Response Fields

FieldTypeDescription
device_codestringSecret code for polling (don't show to user)
user_codestringCode for user to enter (XXXX-XXXX format)
verification_uristringURL for user to visit
verification_uri_completestringURL with code pre-filled
expires_innumberSeconds until codes expire (30 days)
intervalnumberMinimum seconds between poll requests
Request example
curl -X POST https://api.v2.dealmachine.com/v1/auth/device/code \ -H "Content-Type: application/json" \ -d '{ "client_id": "dealmachine-next-cli", "device_name": "MacBook Pro" }'
Response example
{ "device_code": "a1b2c3d4e5f6...", "user_code": "BCDF-GHJK", "verification_uri": "https://dealmachine.com/device/authorize", "verification_uri_complete": "https://dealmachine.com/device/authorize?code=BCDF-GHJK", "expires_in": 2592000, "interval": 5 }