# The CLI asks whether its sign-in was approved.

> https://koi.dog/docs/api/cli-sign-in/poll-device-login/

`POST /api/v1/auth/device/poll` · Key: `none`

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `deviceCode` | `string` | yes | The device code from `POST /auth/device/start`. Poll no faster than its `intervalSeconds`; faster is `429 slow_down`. 1 to 256 characters. |

## Response.

200 OK · JSON object

- **422 validation_failed**: Each schema error appears in `details`.

## Request.

```sh
curl -X POST https://api.koi.dog/api/v1/auth/device/poll \
    -H "Origin: https://app.koi.dog" \
    -H "Content-Type: application/json" \
    -d '{
      "deviceCode": "<device code>"
    }'
```

```js
const res = await fetch("https://api.koi.dog/api/v1/auth/device/poll", {
  method: "POST",
  headers: {
    Origin: "https://app.koi.dog",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    deviceCode: "<device code>",
  }),
});
console.log(await res.json());
```

```python
import requests

r = requests.post(
    "https://api.koi.dog/api/v1/auth/device/poll",
    headers={
        "Origin": "https://app.koi.dog",
    },
    json={
        "deviceCode": "<device code>",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "tokenType": "Bearer",
  "accessToken": "string",
  "grant": {
    "id": "string",
    "workspaceId": "string",
    "personId": "string",
    "hostname": "string",
    "os": "macos",
    "access": { … },
    …
  },
  "issuer": "string",
  "installId": "string"
}
```
