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

# Authentication

> API authentication methods

## API Keys

Generate API keys from your [dashboard settings](https://app.formbnb.com/dashboard/settings). You can create multiple keys with different permissions.

### Using API Keys

Include your API key in the Authorization header:

```bash theme={null}
curl https://api.formbnb.com/forms \
  -H "Authorization: Bearer sk_live_abc123..."
```

### Key Types

| Type | Prefix     | Use Case             |
| ---- | ---------- | -------------------- |
| Live | `sk_live_` | Production API calls |
| Test | `sk_test_` | Development/testing  |

### Form-Level API Keys

For granular access, create form-specific API keys that only allow access to a single form's submissions.

```bash theme={null}
# Form-level key only works for that form
curl https://api.formbnb.com/forms/FORM_ID/submissions \
  -H "Authorization: Bearer fk_abc123..."
```

## Permissions

API keys can have different permission levels:

| Permission | Description                    |
| ---------- | ------------------------------ |
| `read`     | Read submissions and form data |
| `write`    | Create and update forms        |
| `delete`   | Delete forms and submissions   |
| `admin`    | Full access including billing  |

## Security Best Practices

<Warning>
  Never expose API keys in client-side code. Use server-side requests or environment variables.
</Warning>

* Rotate keys periodically
* Use form-level keys when possible
* Set minimum required permissions
* Monitor key usage in dashboard
