Skip to main content
POST
/
track#create-identity
Create Identity
curl --request POST \
  --url 'https://{region}.mixpanel.com/track#create-identity' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'data={
      "event": "$identify",
      "properties": {
          "$identified_id": "ORIGINAL_ID",
          "$anon_id": "NEW_ID",
          "token": "YOUR_PROJECT_TOKEN"
      }
}
' \
  --data strict=0
1
The $identify event payload is only useful for projects using the Original ID Merge system; it has no functionality in other ID management systems. Please review this section of our documentation for more information.
You can also use the import endpoint: https://api.mixpanel.com/import/
curl --request POST \
     --url 'https://api.mixpanel.com/track#create-identity' \
     --header 'accept: text/plain' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data 'data={
      "event": "$identify",
      "properties": {
          "$identified_id": "YOUR_CHOSEN_USER_ID",
          "$anon_id": "ORIGINAL_ANON_ID",
          "token": "YOUR_PROJECT_TOKEN"
      }
}
'
Identify Criteria:
RequiredEvent Object attributes
Event Object propertyTypeDescription
eventString
required
value must be: $identify
propertiesObject
required
properties.distinct_idString
optional
The distinct ID post-identification (same as $identified_id - it will be inferred from $identified_id if not included)
properties.$identified_idString
required
A distinct_id to merge with the $anon_id.
properties.$anon_idString
required
A distinct_id to merge with the $identified_id. The $anon_id must be UUID v4 format and not already merged to an $identified_id.
properties.tokenString
required
The project token.

Body

application/x-www-form-urlencoded
data
string<blob>
default:{ "event": "$identify", "properties": { "$identified_id": "ORIGINAL_ID", "$anon_id": "NEW_ID", "token": "YOUR_PROJECT_TOKEN" } }
required

A JSON object with the required Event Object fields and any additional event properties.

strict
integer

If present and equal to 1, Mixpanel will validate the provided records and return a JSON object with per-record error messages for records that fail validation.

Required range: 0 <= x <= 1

Response

  • 1 - All data objects provided are valid. This does not signify a valid project token or secret.
  • 0 - One or more data objects in the body are invalid.

The response is of type enum<integer>.

Available options:
1,
0