# Authentication

> Web version: https://docs.usewheelhouse.com/pro/authentication · Index of all docs pages: https://docs.usewheelhouse.com/llms.txt

Unless an endpoint's reference page says otherwise, every request needs your integration API key and your user API key.

## Integration API key

Send it in the `X-Integration-API-Key` header.

Every integration authenticates with an integration API key. To get started,
[contact us](mailto:tech-support@usewheelhouse.com) with a description of your use case and we
will set up your integration account.

### Managing your keys

Once your integration account is set up, sign in to Wheelhouse with it and create and revoke keys
yourself on the [Integration Key](https://app.usewheelhouse.com/u/account/integration_token) page, under Channel Admin in your account settings.

* **Environments.** Each key belongs to the testing or the production environment. Testing keys
  are available as soon as your account is set up. Production keys become available once we have
  approved your integration for production. Contact us when you are ready for that review.
* **Shown once.** A key's full value is shown only when you create it. Copy it into your secret
  storage right away: you can't view it again later, on the page or through support. If you lose a
  key, create a new one and revoke the lost one.
* **Up to 3 active keys per environment.** Revoke a key before creating a fourth.
* **Expiry.** Testing keys expire 3 months after they are created. Production keys don't expire
  unless your existing production keys do, in which case a new key expires with the last of them.
* **Rate limit.** A new key gets the lowest rate limit among your active keys in that
  environment, so a rotated key keeps the limit you already have. See
  [Rate Limit](https://docs.usewheelhouse.com/pro/rate-limit.md) for the defaults.
* **Revoking is immediate.** Requests made with a revoked key are rejected with `401`.

### Rotating a key without downtime

1. Create a new key in the same environment.
2. Deploy it to your integration, replacing the old key.
3. Confirm requests succeed with the new key, then revoke the old key.

We recommend rotating keys periodically, and immediately if a key may have been exposed.

## User API key

Send it in the `X-User-API-Key` header.

Requests to the API must be made in a specific User's context. When a user is registered, we will return an
API key for that specific user.

**BOTH API key headers are required** to make Wheelhouse Pro API calls, except for the endpoints that
work without a user context, such as creating a new end user and checking market coverage
(`GET /listings/in_market`). Each endpoint lists the keys it needs.
