---
title: "Poll a device sign-in"
method: POST
path: "/auth/device/token"
---

# Poll a device sign-in

`POST /auth/device/token`

## Request

- Base URL: `https://api.spacecontext.app/v1`
- URL: `https://api.spacecontext.app/v1/auth/device/token`
- Auth: none required

Answers 400 `AUTHORIZATION_PENDING` until the person decides, 400 `SLOW_DOWN` when polled faster than `interval`, 400 `DEVICE_CODE_EXPIRED` after ten minutes, 403 `ACCESS_DENIED` when denied, and the new API key exactly once when approved. Public.

## Request body

- DeviceTokenRequest
  - `device_code` string, required

## Response `200`

The key, once

- DeviceToken
  - `api_key` string, required: The new key: shown once, store it.
  - `key` object, required
    - `id` string, required
    - `name` string, required
    - `mode` 'live' | 'test', required
    - `prefix` string, required
    - `scopes` string[], required
    - `monthly_cap_cents` integer, nullable, required
    - `created_at` string, required
  - `user` ConsoleUser, required
    - `id` string, required
    - `email` string, email, required
    - `name` string, nullable, required
    - `is_pro` boolean, required
    - `is_admin` boolean, required: True only for Space Context staff accounts, which the console shows extra internal pages; false for everyone else.

## Other responses

- `400`: Error response
- `403`: Error response
- `429`: Too many requests. Retry after the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/spacecontext/apis/space-context-api.md) · [All operations](https://skmtc.dev/spacecontext/apis/space-context-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacecontext/apis/space-context-api/revisions/1dca940259b4?raw)
