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

# Mixpanel

> 5 production-ready jobs — user profile clustering to personas, funnel drop-off focus groups, cohort content strategy, event-based persona enrichment, and feature adoption campaigns

Mixpanel holds your product's behavioral truth — who your users are, what they do, where they drop off, and which features they adopt. These five jobs pull that data through Mavera's surfaces (Custom Personas, Focus Groups, Mave Agent, Generate) so your personas, messaging, and campaigns are grounded in real product usage, not survey data.

***

## API Reference Card

| Detail          | Value                                                           |
| --------------- | --------------------------------------------------------------- |
| **Base URL**    | `https://mixpanel.com/api/query`                                |
| **Auth**        | Service Accounts via HTTP Basic Auth (`service_account:secret`) |
| **Rate limits** | 60 queries/hour; 5 concurrent requests                          |
| **Export API**  | `https://data.mixpanel.com/api/2.0/export` (raw events)         |
| **Mavera base** | `https://app.mavera.io/api/v1`                                  |
| **Mavera auth** | `Authorization: Bearer mvra_live_...`                           |

<Info>
  All examples use four environment variables: `MIXPANEL_SERVICE_ACCOUNT` (service account username), `MIXPANEL_SECRET` (service account secret), `MIXPANEL_PROJECT_ID`, and `MAVERA_API_KEY`. Python examples use `requests` with Basic Auth; JavaScript examples use `fetch` with the same auth pattern.
</Info>

***

## Prerequisites

<Steps>
  <Step title="Mixpanel project with data">You need an active Mixpanel project with at least 30 days of tracked events and user profiles. Find your project ID in Mixpanel → Settings → Project Settings.</Step>
  <Step title="Service account">Create a [Service Account](https://developer.mixpanel.com/reference/service-accounts) in Mixpanel → Organization Settings → Service Accounts. Grant it **Analyst** role on your project.</Step>
  <Step title="Mavera API key">Get your key from [Mavera dashboard](https://app.mavera.io/settings/api-keys).</Step>

  <Step title="Environment variables">
    ```bash theme={"dark"}
    export MIXPANEL_SERVICE_ACCOUNT="your-service-account.abc123.mp-service-account"
    export MIXPANEL_SECRET="your-secret-here"
    export MIXPANEL_PROJECT_ID="1234567"
    export MAVERA_API_KEY="mvra_live_xxxxx"
    ```
  </Step>
</Steps>

***

## Jobs

| # | Job                                                                                          | Mixpanel Data           | Mavera Surface          | Output                             |
| - | -------------------------------------------------------------------------------------------- | ----------------------- | ----------------------- | ---------------------------------- |
| 1 | [User Profile Clustering → Personas](/integrations/mixpanel/user-clustering-personas)        | Engage API (profiles)   | Custom Personas         | Behavior-based persona set         |
| 2 | [Funnel Drop-off → Focus Group Investigation](/integrations/mixpanel/funnel-focus-group)     | Funnels API             | Focus Groups            | Step-by-step abandonment insights  |
| 3 | [Cohort Analysis → Content Strategy](/integrations/mixpanel/cohort-content-strategy)         | Cohort data             | Mave Agent              | Retention strategies from behavior |
| 4 | [Event-Based Persona Enrichment](/integrations/mixpanel/event-persona-enrichment)            | Export API (raw events) | Custom Personas         | Power-user vs casual patterns      |
| 5 | [Feature Adoption → Messaging Priorities](/integrations/mixpanel/feature-adoption-campaigns) | Feature usage metrics   | Focus Groups + Generate | Feature awareness campaigns        |

***

## Rate Limits & Production Notes

| Mixpanel Endpoint                      | Limit                         | Strategy                                   |
| -------------------------------------- | ----------------------------- | ------------------------------------------ |
| Query APIs (Insights, Funnels, Engage) | 60 queries/hour; 5 concurrent | Queue queries; 60s retry on 429            |
| Export API (`/api/2.0/export`)         | Separate from query limits    | Stream large exports; process line-by-line |
| Engage API pagination                  | 1,000 profiles/page           | Track `session_id`; each page = 1 query    |

<Warning>
  Mixpanel's **60 queries/hour** limit is strict and applies across all query APIs. If you run all 5 jobs sequentially, budget \~20 queries total. Spread jobs across hours or cache results locally for exploratory analysis.
</Warning>

**Production checklist:**

| Concern                  | Recommendation                                                                                                                                                   |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Service account rotation | Rotate secrets quarterly in Mixpanel → Organization Settings → Service Accounts.                                                                                 |
| Basic Auth security      | Never log or expose the service account credentials. Use environment variables or a secrets manager.                                                             |
| Export API volume        | The Export API returns all events matching the date range. For high-volume projects (1M+ events/day), filter by specific event names or use shorter date ranges. |
| Mixpanel EU residency    | If your project is EU-hosted, use `eu.mixpanel.com` instead of `mixpanel.com` for all API endpoints.                                                             |
| Mavera credits           | Monitor at [Dashboard](https://app.mavera.io/settings/usage). Focus Groups with 3+ personas consume more credits than single Mave calls.                         |
| Caching                  | Cache Engage profiles and funnel data locally — they rarely change more than daily. Re-export events weekly for enrichment jobs.                                 |

***

## What's Next

<CardGroup cols={2}>
  <Card title="All Integrations" icon="plug" href="/integrations">
    50+ API integrations with full code
  </Card>

  <Card title="Mixpanel API Docs" icon="chart-bar" href="https://developer.mixpanel.com/reference/overview">
    Official Mixpanel API reference
  </Card>

  <Card title="Personas API" icon="users" href="/api-reference/personas">
    Full reference for POST /api/v1/personas
  </Card>

  <Card title="Focus Groups API" icon="comments" href="/api-reference/focus-groups">
    Full reference for POST /api/v1/focus-groups
  </Card>

  <Card title="Mave Agent" icon="brain" href="/api-reference/mave">
    Full reference for POST /api/v1/mave/chat
  </Card>

  <Card title="Generate API" icon="wand-magic-sparkles" href="/api-reference/generations">
    Full reference for POST /api/v1/generations
  </Card>
</CardGroup>
