---
title: "Device Authorization Grant endpoint"
method: POST
path: "/api/v1/platform/environments/token"
tags: ["CTI Console"]
---

# Device Authorization Grant endpoint

`POST /api/v1/platform/environments/token`

Single endpoint that handles both the Device Authorization Request
and the Access Token polling, following RFC 8628.

## Headers

- `X-Mock-Scenario` 'pending' | 'slow_down' | 'access_denied' | 'expired_token' | 'success'

## Request body

- union
  - DeviceAuthorizationRequest — Initial request to start the Device Authorization Grant flow.
    - `client_id` string, required — The instance UID.
  - TokenPollingRequest — Polling request to obtain the access token.
    - `grant_type` 'urn:ietf:params:oauth:grant-type:device_code', required — OAuth 2.0 grant type for device authorization.
    - `client_id` string, required — The instance UID.
    - `device_code` string, required — Device verification code from the authorization response.

## Response `200`

OK - Either the Device Authorization Response or a successful
Access Token Response, depending on the request body.

- union
  - DeviceAuthorizationResponse — Response containing the device and user codes.
    - `device_code` string, required
    - `user_code` string, required
    - `verification_uri` string, uri, required
    - `expires_in` integer, required
    - `interval` integer, required
  - TokenResponse — Response containing the OAuth 2.0 access token.
    - `access_token` string, required
    - `token_type` 'Bearer', required
    - `expires_in` integer, required

## Other responses

- `400` — Bad Request - OAuth 2.0 error response while polling for the access token.

---

[API](https://skmtc.net/wazuh/apis/wazuh-cti-console-mock-api.md) · [All operations](https://skmtc.net/wazuh/apis/wazuh-cti-console-mock-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wazuh/wazuh-cti-console-mock-api/versions/ee2cc03b8dfe/schema)
