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

# Authentication

> Learn how to authenticate your Formo API requests. Use your API Key to call to the Formo Events API, Query API, BI integration, and more.

All API endpoints require authentication using either:

* a **Workspace API Key** to query data and fetch profiles
* a **SDK Write Key** to send events

You'll need to include the key or token in the request headers for all API calls.

## Workspace API Key

Find your API key in your workspace settings. Create one with the appropriate scope if you don't have one yet.

<Frame>
  <img src="https://mintcdn.com/formo/nuFtR_srGJt9ffMF/images/workspace-api-key.png?fit=max&auto=format&n=nuFtR_srGJt9ffMF&q=85&s=e334fe33116aa196c4c293945d0ce5b4" alt="Where to find your Workspace API key" width="1016" height="610" data-path="images/workspace-api-key.png" />
</Frame>

To access the Profiles and Query API, include your workspace API key in your request headers as a Bearer token:

```bash theme={null}
Authorization: Bearer <your_workspace_api_key>
```

<Frame>
  <img src="https://mintcdn.com/formo/Qbe3dL6juMIXAS6y/images/auth-flow.png?fit=max&auto=format&n=Qbe3dL6juMIXAS6y&q=85&s=d3addc9526e980365acd496ef851097c" alt="API Authentication Flow Diagram" width="3840" height="2406" data-path="images/auth-flow.png" />
</Frame>

## API Scopes

When creating a Workspace API Key, select the scopes your key needs. Each API endpoint requires a specific scope.

| Scope             | Description                                                     | Required Plan               |
| ----------------- | --------------------------------------------------------------- | --------------------------- |
| `profiles:read`   | Search and get wallet profiles                                  | Scale / Enterprise          |
| `profiles:write`  | Import wallet addresses (requires profiles:read)                | Scale / Enterprise          |
| `query:read`      | Execute SQL analytics queries                                   | Scale / Enterprise          |
| `mcp:read`        | MCP protocol access                                             | Scale / Enterprise          |
| `alerts:read`     | List and get alerts                                             | Scale / Enterprise          |
| `alerts:write`    | Create, update, delete alerts (requires alerts:read)            | Scale / Enterprise          |
| `boards:read`     | List and get boards and charts                                  | Growth / Scale / Enterprise |
| `boards:write`    | Create, update, delete boards and charts (requires boards:read) | Growth / Scale / Enterprise |
| `contracts:read`  | List contracts                                                  | Growth / Scale / Enterprise |
| `contracts:write` | Create, update, delete contracts (requires contracts:read)      | Growth / Scale / Enterprise |
| `segments:read`   | List segments                                                   | Growth / Scale / Enterprise |
| `segments:write`  | Create and delete segments (requires segments:read)             | Growth / Scale / Enterprise |

<Note>
  Write scopes automatically require the corresponding read scope. Profiles, Query, MCP, and Alerts scopes require a Scale or Enterprise plan; Boards, Contracts, and Segments scopes require Growth or above. Create keys with the required scopes in Team Settings > API Keys.
</Note>

## SDK Write Key

Find your SDK Write Key in your project settings.

<Frame>
  <img src="https://mintcdn.com/formo/nuFtR_srGJt9ffMF/images/project-settings.png?fit=max&auto=format&n=nuFtR_srGJt9ffMF&q=85&s=bf6cc91c3dc0d47eaec11e2bc0557cc3" alt="Tokens in project settings page" width="914" height="960" data-path="images/project-settings.png" />
</Frame>

To send events through the Events API, include the SDK Write Key in your request headers:

```bash theme={null}
Authorization: Bearer <token>
```
