This API merges two users in MoEngage based on their ID, which is a client-defined identifier for a user. You can use this API when multiple profiles have been created for a single user. For example, you can merge a user registered once with a mobile number and once with an email ID. You can also merge duplicate users created due to integration or tech issues.
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
Note: After you generate and save the Data API Key, DO NOT generate a new key unless there is a security breach. After you generate a different Data API key and save it, the authentication will start failing. You must update your existing data tracking.
For more information on authentication and getting your credentials, refer here.
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
This field contains the list of UID pairs of the users who are to be merged.
Example:
{
"merge_data": [ // All the different pairs of users to merge
{
"merged_user": "<sample_uid>", // This user will merge into below user
"retained_user": "<sample_uid>" // Above user will merge into this user
},
{
"merged_user": "<sample_uid>", // This user will merge into below user
"retained_user": "<sample_uid>" // Above user will merge into this user
}
]
}This response is returned when the request is processed successfully.
This field contains the status of the request and specifies whether the request was successful. Supported values are : "success", "failure"
"success"
This field contains “created” when there is no error in the payload, and the user merge is successful.
"created"