The Merge User API merges two users in MoEngage based on their ID. ID is a client-defined identifier for a user. This API can be used when multiple profiles have been created for a single user. For example, a user registered once with a mobile number and once with an email id can be merged. Duplicate users created due to integration or tech issues can also be merged.
merged_user after the merge?retained_user, and all the events and user details of merged_user will reflect on the retained_user. A merge event MOE_USER_MERGE_EVENT will be added to the merged_user (who will only have the MoEngage ID now).
retained_user after the merge?retained_user will now have all the user, device, and event details of merged_user along with details of retained_user, MOE_USER_MERGED will be added to retained_user.
ID as the deleted user (which is deleted after the merge)?
We will create a new user with that ID, but the MoEngage ID of this user will be different as compared to the deleted user.
This authentication parameter, used for access control, must be passed along with the request. The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username:password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:
{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}
The username and password details can be obtained from the MoEngage Dashboard. If you're using the API for the first time, follow these steps:
Use these details to authenticate the API requests.
This is the Workspace ID of your MoEngage account that has to be passed along with the request. You can find your Workspace ID at Settings > Account > APIs > Workspace 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"