v1.0.0
OpenAPI 3.1.0

Merge profiles

US region

Client Libraries

Merge profiles

You only need to use this method to support a few select destinations like Mixpanel.

The alias method reconciles identifiers in systems that don't automatically handle identity changes—like when a person graduates from an anonymous user to an identified user.

For example, a person typically has an anonymousId until you identify them by userId. Most destinations will automatically associate data from the anonymous ID with the new user ID when you send an identify call. But a select few destinations, like Mixpanel, won't! The alias call tells Mixpanel to represent the anonymousId with the new userId.

If you need to use the alias call, you'll want to send it before you identify someone with a userId.

If you use our web or server-side libraries, and you've already identified someone, we assume that this is the userId that you want to keep. Otherwise, you need to pass both the previousId and the userId.

When you use our libraries, you'll typically only provide the previousId and userId. The libraries fill in the rest of the payload automatically.

Headers
  • X-Strict-Mode
    enum
    const:  
    1

    When set to 1, enables strict validation that returns proper HTTP error codes (400/401) for validation failures. When not set or set to any other value, the API operates in permissive mode, logging errors but returning HTTP 200. Learn more

    values
    • 1
Body
application/json
  • previousId
    Type: string
    required

    The anonymousId or userId value that you want to merge into the canonical profile.

  • userId
    Type: string
    required

    The userId that you want to keep. This is required if you haven't already identified someone with one of our web or server-side libraries.

Responses
  • 200

    A successful request returns an empty object response.

Request Example for post/alias
curl https://cdp.customer.io/v1/alias \
  --request POST \
  --header 'X-Strict-Mode: 1' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic username:password' \
  --data '{
  "previousId": "",
  "userId": ""
}'
No Body