- api_key: the service account secret.
- service_account_username: its username (
name.xxxxxx.mp-service-account). - project_id: the project id (Project Settings, Overview).
- region:
us(default),euorin, matching the project’s data residency. Every API switches to that region’s hosts. - project_token (optional): needed for
events.track, profile and group updates, identity calls and GDPR, which authenticate with the token. - gdpr_token (optional): the GDPR API OAuth token from Personal Settings, Data & Privacy. A service account gets 401 on the GDPR API.
plan_restricted; profiles.query and raw export
work. Data Pipelines is a paid add-on (401), and the Platform API data
definitions answer 404 until Mixpanel enables them for the project.
Organization-level service account calls need an organization admin or
owner service account (403 otherwise).
- Rate limits. The Query API allows 60 queries per hour and 5 at once; raw export 60 per hour and 3 per second. Core retries a 429 using Retry-After; nothing else is retried.
- Errors come back as core
ApiErrors with Mixpanel’s message anderror_code. Request bodies (tokens, profiles, events) are stripped from the error, and secrets Mixpanel echoes are redacted.
- 119 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Mixpanel API key before the first call: More: API Key
pnpm corsair setup --plugin=mixpanel --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Find profiles on a planWhat’s next
API reference
Every
mixpanel.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.