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.
- enumX
- Strict - Mode const:1When 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 morevalues- 1
- Type: stringprevious
Id requiredThe anonymousId or userId value that you want to merge into the canonical profile.
- Type: stringuser
Id requiredThe 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.
- 200
A successful request returns an empty object response.
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": ""
}'
A successful request returns an empty object response.