---
title: "Poll a device authorization"
method: POST
path: "/api/users/device/token"
tags: ["device"]
---

# Poll a device authorization

`POST /api/users/device/token`

## Request

- Base URL: `https://api.hostim.dev`
- URL: `https://api.hostim.dev/api/users/device/token`
- Auth: none required

Polls a device authorization. Returns pending until the user approves, then the API token exactly once.

## Request body

- object
  - `deviceCode` string, required

## Response `200`

Current state of the authorization

- DeviceTokenResult
  - `status` 'pending' | 'approved' | 'denied' | 'expired', required
  - `token` string: Bearer API token; present only when status is approved.

## Other responses

- `400`: Unknown or already-consumed device code

---

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