# Authentication

> The WP Waterfall API authenticates with a bearer API key on https://api.wpwaterfall.com/v1. The dashboard uses session cookies.

Source: https://docs.wpwaterfall.com/developers/authentication

Send your API key as a bearer token on every request to `https://api.wpwaterfall.com/v1`.

```bash
curl -s https://api.wpwaterfall.com/v1/companies/me \
  -H "Authorization: Bearer wpw_live_YOUR_SECRET"
```

## What do keys look like?

A key starts with `wpw_live_` for a real company or `wpw_test_` for a sandbox company, followed by a random string. A key made before November 14, 2026 starts with `hk_live_` or `hk_test_` and works until it expires or you revoke it. WP Waterfall shows the secret once. A test key never works against a live company: see [Test mode](https://docs.wpwaterfall.com/developers/test-mode). To make a key, see [Create an API key](https://docs.wpwaterfall.com/developers/create-an-api-key). For what a key may do, see [API keys and scopes](https://docs.wpwaterfall.com/api-keys-and-scopes).

To check the key you hold, call `GET /v1/api-keys/current`. It validates the key you sent and returns its scopes.

## What do 401 and 403 mean?

A `401` means the key is missing, unknown, or revoked. Create a new key and copy the secret again. A revoked key stops working within seconds. Every `401` carries a `WWW-Authenticate` header that names the scheme: `Bearer realm="WP Waterfall API"`. When you sent a key and the API refused it, the header adds `error="invalid_token"`. A `403` means the key lacks a scope: invitations need `users:write`, for example, and `GET /v1/companies/me` needs `sites:read`. See [Errors](https://docs.wpwaterfall.com/developers/errors).

## What about dashboard sessions?

The dashboard authenticates with HttpOnly cookies. Cookies are for the browser only. Scripts use a key.

## What is the request ID?

Every response carries an `x-request-id` header. Quote it when you message Nami from the chat button.
