# API keys

> The API key itself: what it may do. Part of the HireHappy API reference (https://hirehappy.io/docs/api).

Base URL: `https://api.hirehappy.io/v1`. Authenticate with `Authorization: Bearer <API key>`.

### Retrieve the API key

`GET https://api.hirehappy.io/v1/api-keys/self`

Any API key.

The API key the request is made with: its name, what it may do and when it expires.

**Example request**

```bash
curl "https://api.hirehappy.io/v1/api-keys/self" \
  -H "Authorization: Bearer $HIREHAPPY_API_KEY"
```

**Response** `200`

| Name | Type | Description |
| --- | --- | --- |
| `id` | uuid |  |
| `name` | string |  |
| `scopes` | array of enum | What the key may do. one of `jobs:read`, `jobs:write`, `candidates:read`, `candidates:write`, `applications:read`, `applications:write` |
| `expires_at` | datetime | Null never expires. nullable |

```json
{
  "id": "5e1d9a47-2c3b-4f80-8d6e-7a9b0c1d2e3f",
  "name": "Careers site",
  "scopes": [
    "jobs:read",
    "applications:read",
    "applications:write"
  ],
  "expires_at": null
}
```

**Errors**: `401` the key is wrong, expired or revoked (api_key_required when missing).
