> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spaportal.cz/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

The API uses a dedicated public key header:

```http theme={null}
X-SpaPortal-Public-Key: <your_public_key>
```

Public keys are 32-character alphanumeric strings. They identify the channel
and scope all requests to it.

## Getting your public key

Every distribution channel in SpaPortal has its own public key. To find yours: `Administration → Distribution Channel → [your channel] → Channel detail → Public keys`

## Authentication errors

| Status | Error code               | Cause               |
| -----: | ------------------------ | ------------------- |
|  `400` | `missing_authentication` | The key is missing. |
|  `401` | `invalid_authentication` | The key is invalid. |

Authentication runs before input validation. A request with both a missing key
and invalid parameters returns the authentication error.
