---
search:
  tags:
    - Account
    - POST
seo:
  description: >-
    Polls a device login. Until the person decides, it answers 400 with
    error.code set… Reference for the POST /_luna/auth/device/token endpoint in
    the Luna API.
sidebar:
  label: Collect a device login
  badge: POST
title: Collect a device login
type: openapi-operation
---
Polls a device login. Until the person decides, it answers 400 with `error.code` set to `authorization_pending`, or `slow_down` when you poll too often. `access_denied` and `expired_token` end the login. No credential is needed.

`POST /_luna/auth/device/token`

**Request body** (`application/json`, required)

- `deviceCode` (string, required) — The \`deviceCode\` that starting the login returned.

Request body example:

```json
{
  "deviceCode": "string"
}
```

**Responses**

- `200` — The login was approved. The key is returned once.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "token": "string",
  "account": {
    "id": "string",
    "email": "string"
  }
}
```
