## Exchange an API key for an access token

`POST /api/hr/v1/auth/token`

Module: HR · operationId: `exchangeApiKey` · Tag: Auth · Auth: API key (`Authorization: Bearer cck_…`)

Send the API key as `Authorization: Bearer cck_…`. The answer is a token every ConnectCloud API accepts as `Authorization: Bearer <accessToken>`. It lives 15 minutes – never past the key's expiry – carries the key's permissions (personal keys: only those the owner still holds) and `authMethod: apikey`, which never opens sign-in, passkey or key management routes. Reuse it until it expires; there is no refresh. Revoking a key, disabling its owner or service account takes effect at the next exchange. Every refusal answers `401 invalid_api_key`. Rate limited per client.

### Responses

- **200** Access token (`application/json`)
- **401** Error (`application/json`)
- **429** Too many requests
- **503** Error (`application/json`)

Fields of the 200 answer:

- `accessToken` (string, required): JWT; treat it as opaque
- `expiresAt` (string (date-time), required): When the access token expires
- `expiresIn` (integer, required): Seconds
- `tokenType` (string, required): Always Bearer

Example 200 answer:

```json
{
  "accessToken": "EXAMPLE.eyJhdXRoTWV0aG9kIjoiYXBpa2V5In0.EXAMPLE-SIGNATURE",
  "expiresAt": "2026-11-19T09:45:00Z",
  "expiresIn": 900,
  "tokenType": "Bearer"
}
```

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/hr/v1/auth/token' \
  -H "Authorization: Bearer $CONNECTCLOUD_API_KEY"
```
