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

# Authentication

All endpoints in the RewardsBot Affiliate Discovery API require authentication via an API key passed in the `x-api-key` request header.

## API key header

Pass your key in the `x-api-key` header on every request:

```bash theme={null}
curl https://rewardsbot-prod.liquidrewardsapi.com/v1/discovery/merchants \
  -H "x-api-key: YOUR_API_KEY"
```

<Warning>
  Treat your API key like a password. Never commit it to source control or expose it in client-side code.
</Warning>

## Optional bearer token

Endpoints also accept an optional bearer (JWT) token via the standard `Authorization` header. When present, it is parsed alongside your API key:

```bash theme={null}
curl https://rewardsbot-prod.liquidrewardsapi.com/v1/discovery/products/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"query": "running shoes"}'
```

## Error responses

| Status | Meaning                                                                       |
| ------ | ----------------------------------------------------------------------------- |
| `403`  | Missing or invalid API key.                                                   |
| `422`  | Request validation failed. Check field names, types, and required parameters. |
| `503`  | Backing service for the requested feature is not configured.                  |

## Getting an API key

Contact [support@liquidrewards.com](mailto:support@liquidrewards.com) to request API access.
