hi, is it possible to get user and his all historical distinct_id over the time?
Hi! This is a nuanced question. Here's what the knowledge sources tell us:
Exporting a User's Current Profile & Distinct ID
You can retrieve a user's current profile (including their canonical distinct_id) using the Engage API:
curl --request POST \
--url 'https://mixpanel.com/api/query/engage?project_id=1234567' \
--header 'accept: application/json' \
--header 'authorization: Basic YOUR_TOKEN' \
--header 'content-type: application/x-www-form-urlencoded'The response includes each profile's $distinct_id and $properties. [Exporting Profiles]
Note: Profiles and events will always export the canonical (resolved) distinct ID as shown in the UI.
Historical Distinct IDs (ID Cluster)
Mixpanel's Simplified ID Merge system merges multiple identifiers (anonymous $device_ids and a $user_id) into an ID cluster. However, the knowledge sources do not explicitly describe an API endpoint that returns the full list of all historical distinct_ids that were ever associated with a user over time.
What is available is:
If you use Data Pipelines (warehouse export), the mp_identity_mappings_data_view table contains mappings of original distinct_ids to the resolved canonical distinct_id. This is the closest thing to a full historical identity map. [Common SQL Queries]
Summary
Goal | Solution |
Get current canonical distinct_id | Engage API |
Get all historical distinct_id mappings | Data Pipelines โ mp_identity_mappings_data_view |
If you don't have the Data Pipelines add-on, the knowledge sources do not describe another way to retrieve the full history of all distinct IDs associated with a user. You may want to reach out to Mixpanel support for further options.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
have all event canonical distinct_id? kapa.ai
Following up on our conversation: no, not all events will have the canonical (resolved) distinct_id attached to them directly in the raw export.
Here's why:
Pipelines export event data as they appear when Mixpanel ingests them. This means events recorded before a user is identified (i.e., before the ID merge happens) will carry the original, pre-merge distinct_id โ not the final canonical one. [JSON Pipelines]
This is also noted in the incremental pipelines documentation: faster exports can lead to more events exported with their original distinct_id rather than the resolved identifier seen in the Mixpanel UI. [Incremental Pipelines]
How to Resolve This
To get the canonical distinct_id for all events, you need to join the events table with the mp_identity_mappings_data_view table and use resolved_distinct_id when available. Example query:
SELECT
DATE(time, 'America/Los_Angeles') AS event_date,
COUNT(DISTINCT resolved_user_id) AS unique_users
FROM (
SELECT
time,
IFNULL(id_mappings.resolved_distinct_id, events.distinct_id) AS resolved_user_id
FROM
`<your dataset>.mp_master_event` AS events
LEFT JOIN
`<your dataset>.mp_identity_mappings_data_view` AS id_mappings
ON
events.distinct_id = id_mappings.distinct_id
WHERE
DATE(time, 'America/Los_Angeles') >= '2025-08-01'
AND DATE(time, 'America/Los_Angeles') < '2025-09-16'
)
GROUP BY 1
ORDER BY 1 ASCThe logic is: use resolved_distinct_id from the mappings table if it exists; otherwise fall back to the event's own distinct_id. This requires the Data Pipelines add-on (available on Growth or Enterprise plans).
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
kapa.ai where is this table mp_identity_mappings_data_view
The mp_identity_mappings_data_view table lives in your data warehouse destination โ it is created automatically by Mixpanel's Data Pipelines export. Here's where to find it depending on your warehouse:
BigQuery
It is created as a view in the BigQuery dataset you configured for Mixpanel exports. Mixpanel creates the underlying table mp_identity_mappings_data_* (with a random suffix) and updates the view mp_identity_mappings_data_view to always point to the latest table. You should always query the view, not the underlying table. [BigQuery Integration]
Snowflake
It is available as MP_IDENTITY_MAPPINGS_DATA in your Snowflake database and schema. Example query:
SELECT *
FROM <DB_NAME>.<SCHEMA_NAME>.MP_IDENTITY_MAPPINGS_DATACloud Storage (S3, GCS, Azure)
The identity mappings data is exported to:
<BUCKET_NAME>/<MIXPANEL_PROJECT_ID>/mp_identity_mappings_data/Key Point
This table/view is only available if you have the Data Pipelines add-on (Growth or Enterprise plan) and have set up an identity pipeline alongside your events pipeline. It is not accessible directly within the Mixpanel UI.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
