Skip to main content
POST/users/merge/

Merge user

You can merge users using REST API. Request requires providing the main user to which attribute values from other users will be merged.

In case multiple users have a value for the same attribute, the value will be taken first from the user to whom the values are to be merged, and then from the user with the lowest ID value.

The contacts in users_list are deleted after the merge: their IDs return 404 from then on.

Attributes

Optional unless marked required

parentintrequired
User to which attributes will be merged
users_listlist of intsrequired
List of users whose attribute values will be merged to the user given as "parent"

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/users/merge/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"parent": 1925,
"users_list": [
1926
]
}'

Response examples​

{
"success": true
}

A 400 lists every field that failed, each with its messages. Besides a missing field, you can get:

FieldMessageWhen
parentClient User with user_id 123 does not existNo contact has that ID.
users_listUsers with these IDs do not exist in the application: [456].One of the IDs isn't a contact, including a contact already merged (merging deletes it).
users_listEnsure this field has at least 1 elements.The list is empty.

Response fields​

Fields returned in the 200 OK response body.

successboolean
true when the contacts were merged.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.