# Request a device authorization code

`GET https://api.cryptohopper.com/v1/device/code`

Part of [Devices](https://www.cryptohopper.com/api-documentation/api-reference/devices.md) in the Cryptohopper API reference.

Emails a new 6 digit authorization code for the device in the deviceId header to the account owner, to be entered with Authorize a device with an emailed code. The device must already be registered, which happens when it signs in.

The handler checks no OAuth scope. A new code can be requested at most once every 30 seconds; sooner returns 405. An already authorized device returns 400 Device already authorized.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Example request

```bash
curl "https://api.cryptohopper.com/v1/device/code" \
  -H "access-token: YOUR_ACCESS_TOKEN"
```

## Response

Example response (illustrative values):

```json
{
    "data": "Code sent"
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
