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

# Authentication and API keys

> Create a Watchdog API key and send it as a bearer token.

Every `/v1` request requires a Watchdog API key in the `Authorization` header.

```http theme={null}
Authorization: Bearer wdg_<your-token>
```

## Create a key

1. Sign in to [Watchdog](https://app.watchdog.no).
2. Open **Settings → API keys**.
3. Choose **Create API key**. You must be an organization administrator.
4. Give the key a name that identifies the consuming service.
5. Copy the token into a secrets manager before closing the dialog.

<Warning>
  Watchdog shows the plaintext token once. It cannot be recovered later. If it is lost or exposed,
  revoke it and create a replacement.
</Warning>

## Send a request

```bash theme={null}
curl https://api.watchdog.no/v1/invoices \
  --header "Authorization: Bearer $WATCHDOG_API_KEY"
```

Keep keys on the server. Do not embed them in browser code, mobile applications, documentation examples, logs, or source control.

## Rotate or revoke a key

Create the replacement before revoking the old key so the consuming service can be updated without interruption. Revoked and disabled keys receive an authentication or authorization error and cannot be re-enabled by the client.
