Skip to main content
POST
/
v1
/
auth
/
device
/
code
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"
  }'
{
  "device_code": "a1b2c3d4e5f6...",
  "user_code": "BCDF-GHJK",
  "verification_uri": "https://dm-next.dealmachine.com/device/authorize",
  "verification_uri_complete": "https://dm-next.dealmachine.com/device/authorize?code=BCDF-GHJK",
  "expires_in": 2592000,
  "interval": 5
}
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).
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"
  }'
{
  "device_code": "a1b2c3d4e5f6...",
  "user_code": "BCDF-GHJK",
  "verification_uri": "https://dm-next.dealmachine.com/device/authorize",
  "verification_uri_complete": "https://dm-next.dealmachine.com/device/authorize?code=BCDF-GHJK",
  "expires_in": 2592000,
  "interval": 5
}

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