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

# API

> Access API keys, manage webhooks, and integrate with external systems.

The **API** section is where you connect Fanhaven to your own systems. Open it from **Settings → API**.

It has three tabs:

* **Documentation** — in-dashboard REST reference and examples
* **API Keys** — create and revoke Bearer keys
* **Webhooks** — HTTPS endpoints for real-time events

<Card title="API reference" icon="code" href="/api-reference/overview">
  Full endpoint docs: authentication, fans, transactions, events, merch, and webhooks.
</Card>

## API keys

API keys authenticate server-to-server requests to `https://api.fanhaven.com/v1`.

### Creating an API key

<Steps>
  ### Open API

  From the dashboard, go to **Settings → API**.

  ### Click "Create key"

  Give the key a name (e.g. "Warehouse sync") and choose scopes.

  ### Copy and store the key

  The secret is shown once. You will not be able to see it again.
</Steps>

### Scopes

| Scope               | Access                          |
| ------------------- | ------------------------------- |
| `fans:read`         | List and retrieve fans          |
| `transactions:read` | List and retrieve sales         |
| `events:read`       | List and retrieve tour dates    |
| `merch:read`        | List and retrieve catalog items |

Keys are bound to the current artist and tour. Send them as:

```
Authorization: Bearer fh_live_...
```

<Warning>Revoked keys cannot be restored. Update external systems with a new key before revoking the old one.</Warning>

## Webhooks

Webhooks send HTTP POSTs to your URL when events happen in Fanhaven. See [Webhooks](/api-reference/webhooks) for payload shape and signature verification.

### Setting up a webhook

<Steps>
  ### Add an endpoint

  On the Webhooks tab, click **Add endpoint** and enter an HTTPS URL.

  ### Select events

  Choose specific events or **All events**.

  ### Save the signing secret

  Use it to verify `X-Fanhaven-Signature` on every request.
</Steps>

## Use cases

| Integration             | How to build it                                 |
| ----------------------- | ----------------------------------------------- |
| **CRM sync**            | `GET /v1/fans` to pull audience data            |
| **Custom analytics**    | `GET /v1/transactions` or a transaction webhook |
| **Warehouse / catalog** | `GET /v1/merch`                                 |
| **Show calendar**       | `GET /v1/events`                                |
