---
title: "Start device authorization for Masko CLI (remote terminals)"
method: POST
path: "/v1/auth/device"
tags: ["Authentication"]
---

# Start device authorization for Masko CLI (remote terminals)

`POST /v1/auth/device`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/auth/device`
- Auth: none required

No bearer required. Show user_code and verification_uri_complete, then poll auth/token at interval seconds. Codes expire after 600 seconds. Explicit signed-in browser approval selects the workspace. Uses the Masko JSON envelope and device-grant semantics, not form-encoded OAuth transport.

## Request body

- object
  - `client_id` 'masko-cli', required
  - `device_name` string, required
  - `scope` 'read' | 'write'

## Response `200`

Success. Cache-Control: no-store.

- object
  - `data` object, required
    - `device_code` string, required
    - `user_code` string, required
    - `verification_uri` string, uri, required
    - `verification_uri_complete` string, uri, required
    - `expires_in` number, required
    - `interval` number, required

## Other responses

- `400`: Validation or device-grant state error.
- `429`: Rate limited.
- `503`: Authentication service unavailable.

---

[API](https://skmtc.dev/masko/apis/masko-api.md) · [All operations](https://skmtc.dev/masko/apis/masko-api/llms.txt) · [OpenAPI document](https://skmtc.dev/masko/apis/masko-api/revisions/84832e255613?raw)
