> ## 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.

# Developers

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

The **Developers** section provides tools for technical integrations beyond the built-in ones (Shopify, Instagram). Use API keys and webhooks to connect Fanhaven with your own systems.

## API keys

API keys allow external applications to authenticate with the Fanhaven API.

### Creating an API key

<Steps>
  ### Navigate to Developers

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

  ### Click "Create API Key"

  Give the key a descriptive name (e.g., "Warehouse System Integration") so you can identify it later.

  ### Copy and store the key

  The API key is shown once at creation. Copy it and store it securely — you won't be able to see the full key again.
</Steps>

### API key scopes

API keys are scoped to:

* **Artist level** — Access to a specific artist's data
* **Tour level** — Access to a specific tour's data

This ensures that external integrations only access the data they need.

### Revoking a key

If a key is compromised or no longer needed:

1. Go to the Developers page
2. Find the key in the list
3. Click **Revoke**
4. The key is immediately invalidated

<Warning>Revoked keys cannot be restored. Any system using the revoked key will immediately lose access. Make sure to update external systems with a new key before revoking the old one.</Warning>

## Webhooks

Webhooks send real-time notifications to external URLs when events happen in Fanhaven.

### Setting up a webhook

<Steps>
  ### Go to Developers

  Navigate to the Developers section.

  ### Click "Add Webhook Endpoint"

  Enter the URL where you want to receive webhook events.

  ### Select events

  Choose which events trigger notifications:

  | Event                    | Description                          |
  | ------------------------ | ------------------------------------ |
  | **Transaction created**  | A sale is completed                  |
  | **Transaction refunded** | A refund is processed                |
  | **Fan created**          | A new fan signs up                   |
  | **Inventory updated**    | Stock levels change                  |
  | **Order status changed** | A mobile/online order status changes |

  ### Save

  The webhook is active and will start sending events to your endpoint.
</Steps>

### Webhook security

Each webhook endpoint has a **signing secret** that you can use to verify that incoming requests are genuinely from Fanhaven:

1. When the webhook is created, a signing secret is generated
2. Each webhook request includes a signature header
3. Your server verifies the signature using the secret

You can **roll the secret** if it's compromised — the old secret becomes invalid immediately and a new one is generated.

### Webhook delivery

* Webhooks are sent as **HTTP POST** requests with a JSON payload
* If your endpoint returns a non-2xx status code, Fanhaven retries the delivery
* Failed deliveries are logged and visible in the Developers section

## Use cases

| Integration              | How to build it                                         |
| ------------------------ | ------------------------------------------------------- |
| **Warehouse management** | Webhook on inventory changes → update your WMS          |
| **Custom analytics**     | Webhook on transactions → feed into your data warehouse |
| **CRM sync**             | Webhook on fan creation → create a contact in your CRM  |
| **Notifications**        | Webhook on high-value transactions → alert in Slack     |

<Info>For most teams, the built-in integrations (Shopify, Instagram) and dashboard features are sufficient. The Developers section is for teams with custom technical needs or existing systems that need to receive Fanhaven data in real time.</Info>
