---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/data-destinations/destination/mixpanel#article
headline: Mixpanel destination
description: Learn how to send event data to Mixpanel for product and behavioral analytics.
url: https://www.twilio.com/docs/data-destinations/destination/mixpanel
inLanguage: en
dateModified: 2026-11-04T17:24:28.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Mixpanel destination

> \[!IMPORTANT]
>
> Data Destinations is currently available as a Private Beta product and the information contained in this document is subject to change. Data Destinations is not a HIPAA Eligible Service or PCI compliant and should not be enabled in workflows that are subject to HIPAA or PCI. To learn more, see [Private beta legal information](/docs/data-destinations#private-beta-legal-information).

[Mixpanel](https://mixpanel.com/) is a product and behavioral analytics platform that lets you turn Twilio events into named, user-attributed events for funnels, retention, and segmentation analysis.

### Destination overview

* **Category**: Analytics
* **Release status**: Beta
* **Authentication**: Basic authentication
* **Regional availability**: US1

## Join the Data Destinations private beta

[Sign up](https://airtable.com/appaJfyV6LiIFMxuP/pagIaOAtKsQVxTfdW/form)

Get early access to native destinations for data warehouses, observability tools, and event pipelines.

## Eligible events

**Identifier-restricted eligibility**: Twilio can only send events that contain an end-user identifier (such as a phone number or user ID) to Mixpanel. Mixpanel requires every event to carry a Distinct ID, and unlike some other analytics destinations, Mixpanel has no anonymous or device-level fallback identity. Twilio never uses your Account SID as a substitute identifier, since doing so would collapse unrelated events onto a single Mixpanel identity.

Twilio can currently send the following event types to Mixpanel:

* **Messaging**: [inbound message received](/docs/events/event-types/messaging/inbound-message#received), [message queued](/docs/events/event-types/messaging/outbound-message#queued), [message sent](/docs/events/event-types/messaging/outbound-message#sent), [message delivered](/docs/events/event-types/messaging/outbound-message#delivered), [message failed](/docs/events/event-types/messaging/outbound-message#failed), [message undelivered](/docs/events/event-types/messaging/outbound-message#undelivered), [message read](/docs/events/event-types/messaging/outbound-message#read)
* **Voice**: [call answered](/docs/events/event-types/voice/call-progress-event#answered-1), [call initiated](/docs/events/event-types/voice/call-progress-event#initiated-1), [call ringing](/docs/events/event-types/voice/call-progress-event#ringing-1), [call completed](/docs/events/event-types/voice/call-progress-event#completed-1), [call redirected](/docs/events/event-types/voice/twiml#call-redirected), [call requested](/docs/events/event-types/voice/twiml#requested), [call transferred](/docs/events/event-types/voice/twiml#call-transferred), [dial finished](/docs/events/event-types/voice/twiml#dial-finished), [enqueue finished](/docs/events/event-types/voice/twiml#enqueue-finished), [gather finished](/docs/events/event-types/voice/twiml#gather-finished), [record finished](/docs/events/event-types/voice/twiml#record-finished), [media fetched](/docs/events/event-types/voice/media#fetched)
* **Voice Insights**: [call summary complete](/docs/events/event-types/voice-insights/call-summary#complete)

All other event types aren't currently eligible for this destination. See [event types](/docs/events/event-types-overview) for the full list of available event types.

## Get started

### Prerequisites

Before you set up a Mixpanel destination, make sure you have:

* A Mixpanel project.
* A Mixpanel **Service Account** with the **Owner** or **Admin** role on that project. The Import API this destination uses rejects service accounts with lesser roles. Create one in your project's Service Accounts settings.
* The service account's **Username** and **Secret**. Mixpanel shows the secret only once, when you create it, so save it securely.
* Your Mixpanel project's numeric **Project ID**.

## Create the destination

> \[!NOTE]
>
> See [Set up a destination](/docs/data-destinations/destination-setup) for the full UI and Destinations API setup flow common to every destination type.

### Twilio Console

To create a Mixpanel destination in the Twilio Console:

1. From your Mixpanel account, gather the settings listed in [Destination settings](#destination-settings).
2. In the Twilio Console, go to **Data** > **Data Destinations** > **Destinations** > **Add destination subscription**.
3. Complete the **Add destination subscription** wizard.

### Destinations API

To create a Mixpanel destination through the Destinations API, send a `POST` request to the Destinations endpoint and set `destinationType` to `mixpanel`. For authentication and the other request body fields, see [Create a destination](/docs/data-destinations/api-quickstart#create-a-destination).

```text title="Create a destination"
POST "https://destinations.twilio.com/v1/ControlPlane/Destinations"
```

Set the `config` object in the request body as follows:

| Name                                                      | Type           | Description                                                                                       |
| --------------------------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------- |
| `credentials.credentialType` <br />(**Required**)         | string         | Set to `BASIC`.                                                                                   |
| `credentials.serviceAccountSecret` <br />(**Required**)   | string         | Your Mixpanel service account secret, which Mixpanel shows once when you create the account.      |
| `credentials.serviceAccountUsername` <br />(**Required**) | string         | Your Mixpanel service account username. The account needs the Owner or Admin role on the project. |
| `projectId` <br />(**Required**)                          | string         | Your Mixpanel numeric project ID.                                                                 |
| `region`                                                  | enum`<string>` | Your Mixpanel data residency region. The default is `US`. Valid values: `US`, `EU`, `IN`.         |

The following example shows a request body. Replace the uppercase placeholder values with your own.

```json title="Example request body"
{
  "destinationType": "mixpanel",
  "name": "My Mixpanel destination",
  "config": {
    "credentials": {
      "credentialType": "BASIC",
      "serviceAccountSecret": "SERVICE_ACCOUNT_SECRET",
      "serviceAccountUsername": "SERVICE_ACCOUNT_USERNAME"
    },
    "projectId": "PROJECT_ID"
  }
}
```

## Destination settings

Use `mixpanel` as the `destinationType`.

| Field                    | Description                                                                                                                | Required | Default or choices         |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------- |
| Service Account Username | Your Mixpanel Service Account username. Sent as the HTTP Basic Auth username on every request.                             | Yes      | N/A                        |
| Service Account Secret   | Your Mixpanel Service Account secret. Sent as the HTTP Basic Auth password on every request. Sensitive (stored encrypted). | Yes      | N/A                        |
| Project ID               | Your Mixpanel project's numeric ID.                                                                                        | Yes      | N/A                        |
| Region                   | Your Mixpanel project's data residency.                                                                                    | No       | `US` (default), `EU`, `IN` |

Twilio authenticates to Mixpanel by using HTTP Basic Auth. Twilio sends your **Service Account Username** and **Service Account Secret** on every request. Twilio requires a service account rather than a project token because only service account credentials can be verified with a live check when you save the destination.

## Default mappings

| Field                                           | Mixpanel field                              |
| ----------------------------------------------- | ------------------------------------------- |
| Event type                                      | Event Name                                  |
| End-user identifier (for example, phone number) | Distinct ID                                 |
| Event time                                      | Time                                        |
| CloudEvent ID                                   | Insert ID (used for delivery deduplication) |
| Event payload                                   | Properties                                  |

Mixpanel truncates string property values over 255 characters, limits events to 255 properties, and limits nesting depth to 3. Twilio doesn't modify or drop properties beyond what Mixpanel enforces on ingest. Twilio sends your end-user identifier to Mixpanel unhashed. If you need it hashed, apply your own transformation in the subscription's binding mapping.

## Verification and troubleshooting

When you save a Mixpanel destination, Twilio validates your Service Account Username and Secret against Mixpanel before marking the destination active. This check doesn't confirm that the service account has the Owner or Admin role on your Project ID. A service account with a lesser role passes validation, and Mixpanel rejects it the first time Twilio tries to import events.

Twilio doesn't currently offer a way to manually trigger a test event for this destination, from either the Console or the CLI. To confirm delivery works, wait for a real event of a subscribed type to occur.

### Common errors

| Cause                                                                                                 | What you'll see                                                                                                                                                   | Fix                                                                                                                     |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Invalid or revoked Service Account credentials                                                        | Validation fails with an auth error                                                                                                                               | Re-check the username and secret in Mixpanel and update the destination                                                 |
| Service Account lacks Owner/Admin role on the project                                                 | Passes validation, then delivery errors reported in the [Debugger](/docs/usage/troubleshooting/debugging-your-application)                                        | Grant the Service Account Owner or Admin role on the project                                                            |
| Event missing an end-user identifier                                                                  | Event is not delivered to Mixpanel                                                                                                                                | See [Eligible events](#eligible-events). Twilio can send only events that carry an identifier                           |
| Mixpanel rejects the request as too large (413)                                                       | Delivery errors reported in the [Debugger](/docs/usage/troubleshooting/debugging-your-application)                                                                | Reduce the size of your event payload                                                                                   |
| Mixpanel rate-limiting requests (429)                                                                 | Delivery errors reported in the [Debugger](/docs/usage/troubleshooting/debugging-your-application)                                                                | Retry is automatic. Sustained errors might indicate you've exceeded the Mixpanel rate limit                             |
| Mixpanel rejects specific events in a batch as malformed (400)                                        | Only the flagged events fail; other events in the same batch still deliver, as reported in the [Debugger](/docs/usage/troubleshooting/debugging-your-application) | Check the flagged events' payload shape; sibling events don't need to be resent                                         |
| Mixpanel returns 200 but imports fewer events than sent (`num_records_imported` below the batch size) | No error is reported. Twilio treats the whole batch as delivered                                                                                                  | This is a rare partial-import quirk on Mixpanel's side; cross-check your Mixpanel event counts if you suspect data loss |

If Twilio can't deliver events to your destination, Twilio sends an error notification to the [Debugger](/docs/usage/troubleshooting/debugging-your-application) (available in US1 region only). If Twilio continues to encounter delivery errors, Twilio notifies you every 20 minutes after the initial error.

## Additional resources

* [Destinations overview](/docs/data-destinations/destinations-overview)
* [Set up a destination](/docs/data-destinations/destination-setup)
* [Event types reference](/docs/events/event-types-overview)
