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

# API overview

> The public endpoints of ManaLens, the keys that authorize them, and the error format.

ManaLens has two public interfaces: the **event collector**, which takes events with the publishable key or the secret key, and the **MCP server**, which reads reports with an API key or an OAuth token.

| Interface | Endpoint | Key | Where to get it |
| - | - | - | - |
| [Website and game events](https://docs.manalens.dev/api/events.md#browser-events) | `POST /v0/events` | Publishable key, header `X-Publishable-Key` | Project settings, **Credentials**, **Publishable key** |
| [Server events](https://docs.manalens.dev/api/events.md#server-events) | `POST /v0/events` with `channel: 'server'` | Secret key `ua_sk_...`, `Authorization: Bearer` | Project settings, **Credentials**, **Secret key** |
| [Identify (legacy)](https://docs.manalens.dev/api/identify.md) | `POST /v0/identify` | Publishable key, `X-Publishable-Key` | Project settings, **Credentials**, **Publishable key** |
| [Tracking config](https://docs.manalens.dev/api/identify.md#tracking-config) | `GET /v0/tracking/config` | Publishable key, `X-Publishable-Key` | Project settings, **Credentials**, **Publishable key** |
| [Profile properties](https://docs.manalens.dev/api/profiles/update-properties.md) | `PUT /v0/projects/{projectId}/profiles/.../properties` | API key with `profiles:write`, `Authorization: Bearer` | Project settings, **Integrations**, **API keys** |
| [MCP server](https://docs.manalens.dev/mcp/overview.md) | `POST /mcp` | API key `ua_api_...` or an [OAuth](https://docs.manalens.dev/mcp/oauth.md) token, `Authorization: Bearer` | Project settings, **Integrations**, **API keys** |

ManaLens also sends outgoing requests to you: [alert webhooks](https://docs.manalens.dev/api/alert-webhooks.md), signed with a per-alert secret.

> [!NOTE]
>
> The dashboard uses a private API for reports, dashboards and settings. It is not a public API and can change without notice. To read reports or change dashboards from your own tools, use the [MCP server](https://docs.manalens.dev/mcp/overview.md).

## Base URL

Use the collector endpoint shown on your project's setup page, for example `https://YOUR_COLLECTOR_ENDPOINT`. Behind a [reverse proxy](https://docs.manalens.dev/guides/reverse-proxy.md), browser events can use your own domain instead.

## Keys

* **Publishable key:** one per project. Safe to ship in a page or a game build. It sends website and game events, and nothing else. For a browser, the collector also checks that the origin is your project domain or an allowed origin, and that each web page URL is on your project domain.
* **Secret key:** one per project, for your backend only. It sends server events, and nothing else.
* **API key:** secret, read-only by default, with [scopes](https://docs.manalens.dev/mcp/overview.md#scopes). It reads and manages through the REST API and the MCP server. A project can have several. Each can be revoked.

Never put a secret key or an API key in browser, mobile or game code. See [authentication](https://docs.manalens.dev/api/authentication.md).

## Errors

Errors return JSON with a code and a message:

```json theme={null}
{ "error": { "code": "INVALID_EVENT", "message": "Invalid event payload" } }
```

See [errors](https://docs.manalens.dev/api/errors.md) for every code and which ones to retry.

## Retries

Each event has a `message_id`. Reports count each `message_id` once, so a retry with the same ID does not count twice. See [idempotency](https://docs.manalens.dev/api/idempotency.md).

## Rate limits

* **Events:** each project has a per-minute event limit that is far above normal traffic. It stops an abused key from flooding the collector. Server events have their own limit, so browser traffic does not use up the quota of your backend. Over the limit, the collector returns `429` `RATE_LIMITED` with a `Retry-After` header. Each request is also limited by batch size.
* **MCP:** per-key and per-workspace limits. See [MCP limits](https://docs.manalens.dev/mcp/overview.md#limits).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.