Everything an AI agent can do with the Mixpanel API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints27
AuthenticationService account / project token
Last updated23 June 2026
Orientation

How the Mixpanel API works.

The Mixpanel API is how an app or AI agent works with a Mixpanel project: recording events, updating the people and group profiles those events belong to, and running segmentation, funnel, and retention reports over what has been collected. Sending data in is authenticated with a project token, while reading reports and exporting raw data uses a service account whose project role, like Consumer, Analyst, Admin, or Owner, decides what it can reach. Mixpanel has no per-method permissions, so that one role governs the whole read side.

27Endpoints
6Capability groups
11Read
16Write
0Permissions
Authentication
Mixpanel uses two credentials. Sending data in, like events and profile updates, needs only the project token, identified in the request body. Reading reports and exporting data uses a service account, a non-human user whose username and secret are passed with HTTP Basic auth, alongside the project_id. A legacy API secret still works but is being deprecated in favour of service accounts.
Permissions
Mixpanel has no per-endpoint scopes. A service account is assigned a project role, one of Consumer (view-only), Analyst (build and export reports), Admin, or Owner, and that single role governs everything the account can read or do. There is no way to grant one report and deny another, so the role is the whole access boundary on the read side.
Two APIs
The Ingestion API sends data in, at a high-throughput host, and is the only half a project token can use. The Query API and Export API read data back out, run reports, and download raw events, and require a service account. The two are metered and authenticated separately, which is why an agent that only sends events never needs a service account at all.
No webhooks
Mixpanel does not push events to a registered endpoint. An integration that needs to react to activity does so by polling a query or exporting events on a schedule, not by receiving a callback. The closest thing to an outbound signal is a warehouse connector or data pipeline that syncs data out to a destination.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Mixpanel determines what it can reach. There is a route for sending data in, a route for running reports and reading raw data back out, and a hosted server that exposes Mixpanel tools to agents, and each is governed by the credential behind it: a project token for sending data, or a service account whose project role decides what it can read.

Ways to connect

Ingestion API

The Ingestion API sends data into a project, at https://api.mixpanel.com (with regional hosts for the EU and India). It records events through Track Events and Import Events, and updates user and group profiles through the engage and groups endpoints. Calls identify the project with a project token in the request body and accept JSON, with gzip compression supported for batches.

Best forSending events and profile updates into Mixpanel.
Governed byThe project token in the request body.
Docs ↗

Query & Export APIs

The Query API runs reports, like segmentation, funnels, retention, insights, and JQL, at https://mixpanel.com/api/query, returning computed results. The raw Export API streams the underlying events for a date range as newline-delimited JSON, on a separate host at https://data.mixpanel.com/api/2.0/export. Both authenticate with a service account over HTTP Basic auth and require the project_id.

Best forRunning reports and exporting raw data out of Mixpanel.
Governed byThe service account and the project role it holds.
Docs ↗

MCP server

A first-party, hosted Model Context Protocol server lets AI agents and LLM clients query Mixpanel in natural language. It runs at regional endpoints (https://mcp.mixpanel.com/mcp for the US, plus EU and India variants) and exposes tools for insights, funnels, flows, retention, dashboards, metrics, session replays, and data discovery. It authenticates with OAuth, where a person signs in through a browser, or with a service account for automated use. Most tools are generally available, with Experiments and Feature Flags in open beta.

Best forConnecting an AI agent to Mixpanel through MCP.
Governed byThe OAuth sign-in or service account, and the project role behind it.
Docs ↗
Authentication

Project token

The project token identifies which project data belongs to. It is sent in the body of ingestion calls, as $token on profile updates or as the token on events, and is the only credential the Ingestion API needs. A token can send data but cannot read reports or export data.

TokenProject token (in the request body)
Best forSending events and profile updates into a project.
Docs ↗

Service account

A service account is a non-human Mixpanel user with a username and a secret, designed for scripts and automated workflows. It authenticates the Query and Export APIs over HTTP Basic auth, with the project_id supplied as a parameter. Its project role, one of Consumer, Analyst, Admin, or Owner, governs everything it can do; there are no per-method scopes. The secret is shown only once, when the account is created.

TokenService account username and secret (HTTP Basic)
Best forReading reports and exporting data with least-privilege access.
Docs ↗

Project secret (legacy)

The legacy project secret is sent as the HTTP Basic auth username, with an empty password, and authenticates Query and Export calls without a project_id parameter. Mixpanel is deprecating it in favour of service accounts, which scope access by role and can be rotated independently.

TokenProject API secret (HTTP Basic username)
Best forOlder integrations not yet moved to service accounts.
Docs ↗
Capability map

What an AI agent can do in Mixpanel.

The Mixpanel API splits into two halves: sending data in, like recording events and updating the people and groups that data is attached to, and reading insight back out, like running segmentation, funnel, retention, and insights reports or exporting raw events. Sending data in needs only a project token, while reading reports needs a service account, and what that account can reach depends on the role it holds.

Endpoint reference

Every Mixpanel API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Events (ingestion)

Methods for sending events into a project and managing identity.4

Ingestion needs only the project token, not a service account. Mixpanel has no per-method scope.

Acts onevent
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Accepts a project token or a service account. With strict validation on, failures come back as a per-event error array inside a 200.

Acts onevent
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitUp to 2,000 events and 10MB per request

Part of the identity-management ingestion flow; project token only.

Acts onidentity
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Irreversibly combines two profiles' history. Project token only.

Acts onidentity
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

People profiles (ingestion)

Methods for setting and updating the people that events belong to.6

The $token in the body identifies the project. No per-method scope.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Useful for first-seen values like signup date. Project token only.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Atomic increment, for counters like total purchases. Project token only.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Adds to a list without replacing it. Project token only.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Removes the profile; does not delete the person's events. Project token only.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Batches up to 2,000 profile updates per request. Project token only.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitUp to 2,000 profiles per request

Group profiles (ingestion)

Methods for setting and updating group profiles, like accounts or companies.4

Group profiles support group analytics. Project token only.

Acts ongroup_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Union merges values into a list, de-duplicated. Project token only.

Acts ongroup_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Removes the group profile. Project token only.

Acts ongroup_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitPart of the 2GB/min ingestion ceiling

Batches group profile updates. Project token only.

Acts ongroup_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitUp to 2,000 groups per request

Query (reports)

Methods for running segmentation, funnel, retention, insights, and JQL reports.8

Needs a service account; reach is set by its project role, not a per-method scope.

Acts onsegmentation_report
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Service account; role governs access.

Acts onfunnel_report
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Service account; used to find a funnel_id for the funnels query.

Acts onfunnel
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Service account; role governs access.

Acts onretention_report
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Service account; role governs access.

Acts oninsights_report
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

The most flexible read; runs arbitrary analysis over the whole dataset. Service account; role governs access.

Acts onjql_query
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Service account; role governs access.

Acts onevent_counts
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Service account; used to discover an event's schema before querying it.

Acts onevent_properties
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Export (raw data)

Methods for downloading the raw underlying events and querying profiles.2

Reads stored profile data back out, including personal properties. Service account; role governs access.

Acts onuser_profile
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitCounts against 60 queries/hour, 5 concurrent

Returns row-level events, the rawest read. On its own host (data.mixpanel.com) with a tighter limit. Service account; role governs access.

Acts onraw_event
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit60 queries/hour, 3/sec, 100 concurrent

Lexicon (schemas)

Methods for reading and writing the data dictionary that describes events and properties.3

Reads the data dictionary. Service account; role governs access.

Acts onschema
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit5 requests/min

Changes how an event or property is described project-wide. Service account; role governs access.

Acts onschema
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit5 requests/min, under 4,000 updates/min

Removes a schema definition. Service account; role governs access.

Acts onschema
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit5 requests/min
No endpoints match those filters.
Webhooks

Webhook events.

Mixpanel does not push events out to a registered endpoint. It is built to receive data, so an integration learns about activity by running a query or exporting events, not by waiting for a callback.

EventWhat it signalsTriggered by
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Mixpanel limits the two halves of its API differently: a high-throughput ceiling on how much data can be sent in per minute, and a much tighter ceiling on how many reports can be run per hour.

Request rate

Mixpanel meters its two halves separately. The Ingestion API allows 2GB of uncompressed JSON per minute, roughly 30,000 events per second, measured on a rolling one-minute window, and a single /import request takes up to 2,000 events and 10MB uncompressed. The Query API is far tighter: 60 queries per hour with at most 5 running at once. The raw Export API allows 60 queries per hour, 3 per second, and up to 100 concurrent. The Lexicon schemas API allows 5 requests per minute. Going over any limit returns HTTP 429, and Mixpanel recommends exponential backoff with jitter.

Pagination

Reports return a complete result set for the requested window rather than a cursor-paged feed, so the unit of work is the query, not the page. The raw Export API streams events as newline-delimited JSON for the requested date range, read as a stream rather than in fixed pages. Profile queries (engage) page through results with a session_id and a page number.

Request size

A single /import request accepts at most 2,000 events and 10MB uncompressed per call. Individual event and profile properties have their own field-size limits. The Lexicon schemas API caps updates at under 4,000 events and properties per minute and fewer than 3,000 truncations or deletions per request.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
200ingestion error arrayAn ingestion request was accepted at the HTTP level but individual events may still have failed. With strict validation on, the response lists per-event errors, like a missing event name or an invalid token, rather than failing the whole call with a status code.Read the per-event error array in the body, fix the offending events, and resend only those. Do not assume a 200 means every event was stored.
400Bad RequestThe request was malformed: invalid JSON, a missing required parameter, or a batch that breaks a size or shape rule.Validate the payload against the endpoint's schema and the 2,000-event, 10MB batch limits, then resend.
401UnauthorizedAuthentication failed: a missing or wrong project token on ingestion, or invalid service account credentials on a query.Confirm the token or service account username and secret are correct and meant for this project, and rotate the secret if it is compromised.
403ForbiddenThe credential is valid but lacks the project role the request needs, for example a Consumer service account attempting an export, or it is not attached to the project.Grant the service account the project role the request requires, or attach it to the project, then retry.
413Payload Too LargeAn ingestion batch exceeded the per-request size limit of 2,000 events or 10MB uncompressed.Split the batch into smaller requests under the limits and resend.
429Too Many RequestsA rate limit was hit: the 2GB-per-minute ingestion ceiling, the 60-per-hour query limit, or the export per-second or concurrency caps.Back off exponentially with jitter, starting around 2 seconds and doubling up to 60 seconds, then resend.
500Server ErrorAn error on Mixpanel's side, which can also appear as 502, 503, or 504. It is rare.Retry with backoff, and contact Mixpanel support if it persists.
Versioning & freshness

Version history.

Mixpanel does not use dated version numbers. There is a single, continuously updated API, with changes shipped through release notes rather than a version an integration pins to.

Version history

What changed, and when

Latest versionCurrent
CurrentCurrent version
Continuously updated, unversioned API

Mixpanel does not pin a dated API version. The Ingestion, Query, and Export APIs are continuously updated, and notable changes ship through the changelog rather than a version an integration selects. Some paths carry a numeric segment, like /api/2.0/export, but that is part of the path, not a selectable version.

What changed
  • Ingestion uses a project token; Query and Export use a service account governed by its project role.
  • No per-method scopes and no outbound webhooks.
2026-06
Experimentation 2.0 and Feature Flagging

Mixpanel shipped a re-architected experimentation system alongside feature flagging, with API methods to create, launch, and conclude experiments and to manage and evaluate feature flags. The matching MCP tools are in open beta.

What changed
  • Experiments API: create, launch, decide, conclude, archive.
  • Feature Flags API: create, list, update, delete, and evaluate variant assignments.
2026-04
TLS 1.0 and 1.1 retired

Starting April 2026, Mixpanel APIs no longer accept connections using TLS 1.0 or 1.1. Integrations must use TLS 1.2 or higher.

What changed
  • Connections below TLS 1.2 are rejected across all Mixpanel APIs.
2026-02-10Feature update
Warehouse Connectors Mirror mode

Warehouse Connectors gained Mirror mode, which keeps Mixpanel in sync with a source warehouse by reflecting additions, updates, and deletions. Supported for Snowflake, BigQuery, and Databricks.

What changed
  • Mirror mode added to warehouse imports for Snowflake, BigQuery, and Databricks.
2025-09-10Feature update
Mixpanel MCP server (beta)

Mixpanel launched a first-party Model Context Protocol server, letting AI assistants query analytics data in natural language. It authenticates with OAuth or a service account and runs at regional endpoints.

What changed
  • Hosted MCP server exposing insights, funnels, retention, dashboards, and data discovery tools.
  • Experiments and Feature Flags tools added later in open beta.

There is no version to pin; track the changelog for new methods and deprecations.

Mixpanel changelog ↗
Questions

Mixpanel API, answered.

What's the difference between the project token and a service account?+
They authenticate different halves of the API. The project token identifies a project for sending data in, so it appears in the body of ingestion calls like Track Events, Import Events, and profile updates. A service account is a non-human user with a username and secret, used for the Query and Export APIs to read reports and raw data, passed with HTTP Basic auth alongside the project_id. Sending data needs only the token; reading data needs the service account.
How are permissions scoped on the Query API?+
They aren't, at the method level. Mixpanel has no per-endpoint scopes. A service account holds a single project role, Consumer, Analyst, Admin, or Owner, and that role governs everything it can read or do across the whole Query and Export surface. To limit an account, grant it the least-privilege role it needs, for example Analyst for reporting, rather than expecting to allow one report and deny another.
Does Mixpanel support webhooks?+
Not for pushing events out. Mixpanel is built to receive data, so there is no outbound webhook that fires when something happens in a project. An integration that needs to react polls a query or exports events on a schedule. For moving data out continuously, Mixpanel offers warehouse connectors and data pipelines that sync to a destination, which is a separate mechanism from a per-event callback.
What are the rate limits, and how should an agent handle a 429?+
The Ingestion API allows 2GB of uncompressed JSON per minute, about 30,000 events per second. The Query API allows 60 queries per hour with 5 concurrent, and the Export API allows 60 per hour, 3 per second, and 100 concurrent. A request over any limit returns HTTP 429. Mixpanel recommends backing off exponentially with jitter, starting around 2 seconds and doubling up to 60 seconds, rather than retrying immediately.
Is the Mixpanel API versioned?+
No. There is no dated version to pin and no version header to send. The API is continuously updated, and notable changes, new methods, deprecations, and security requirements like the move to TLS 1.2, are published in the changelog. Some paths carry a numeric segment such as /api/2.0/export, but that is part of the path, not a version an integration selects.
Is there an official Mixpanel MCP server?+
Yes. Mixpanel hosts a first-party Model Context Protocol server that lets an AI assistant query insights, funnels, retention, session replays, dashboards, and more in natural language. It runs at regional endpoints (US, EU, and IN) and authenticates either with OAuth, where a person signs in through a browser, or with a service account for automated use. Most tools are generally available, with the Experiments and Feature Flags tools in open beta.
How do I export raw events versus running a report?+
They are different APIs. The Query API runs aggregated reports, like segmentation, funnels, retention, and insights, and returns computed results. The raw Export API, on a separate host, streams the individual underlying events for a date range as newline-delimited JSON. Both require a service account, but the Export API has its own tighter limit of 60 queries per hour and 3 per second.
Related

More analytics API guides for agents

What is Bollard AI?

Control what every AI agent can do in Mixpanel.

Bollard AI sits between a team's AI agents and Mixpanel. Grant each agent exactly the access it needs, send-in or read-back, report by report, and every call is checked and logged.

  • Set read or full access per agent, never a shared service account secret.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Mixpanel
Analytics Agent
Run reports ActionOffReadFull use
Export raw events ActionOffReadFull use
Send events ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Mixpanel