# Start a device-code key request

> Public. Returns a device code to poll with and an approval URL to show the user. Pick a `name` that says who is asking.

### POST /v1/keys/request

**Start a device-code key request**

Public. Returns a device code to poll with and an approval URL to show the user. Pick a `name` that says who is asking.

Auth: none (public).

Request body (application/json):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Default `API key`. |

Responses:

| Status | Meaning |
| --- | --- |
| 201 | The pairing. |
| 400 | Invalid body. |
| 429 | Rate limited: 60 requests a minute per address. Carries Retry-After. |

Response body (201):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `deviceCode` | string | yes |  |
| `userCode` | string | yes |  |
| `approvalUrl` | url | yes |  |
| `expiresInSeconds` | integer | yes |  |
| `pollIntervalSeconds` | integer | yes |  |

Example (curl):

```bash
curl -X POST https://api.raylight.app/v1/keys/request \
  -H "Content-Type: application/json" \
  -d '{ "name": "CI on acme/web" }'
```

## More

- Previous: [Decline through a link](https://www.raylight.app/docs/reference/post-production-links-token-decline.md)
- Next: [Poll a key request](https://www.raylight.app/docs/reference/post-v1-keys-poll.md)
- All docs: https://www.raylight.app/llms.txt
- Everything in one file: https://www.raylight.app/llms-full.txt
- OpenAPI: https://api.raylight.app/v1/openapi.json
