

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This article describes the endpoints that force merging profiles. For other situations where profiles are merged, see the [User Guide](/docs/crm/profile-merge).

</div></div></div>


Sometimes, multiple profiles refer to the same customer. In that case, they need to be merged.  
In such cases, a number of _source_ profiles are merged into a _target_ profile. The source profiles are deleted after merging.  

After the merge is complete, a [client.merge](/docs/assets/events/event-reference/profiles#clientmerge) event is saved to the target profile.

With the endpoints described below, you can force a merge. This can be used to:
- merge recognized profiles.  
    In this case, the identifiers (such as email or customId) of the source profiles are lost, as described in ["Properties, tags, and attributes"](#properties-tags-and-attributes).
- merge a recognized profile into an anonymous one.  
    In this case, the target profile remains anonymous.


  <div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

  - This operation is **irreversible**. Use it carefully.
  - The source profiles are **deleted**.
  - Don't merge more than 20 accounts at once.

  </div></div></div>


## Identities and event history

UUIDs (including historical UUIDs) of the source profiles are added to the historical UUIDs of the target profile.  
Thanks to this, events of source profiles become associated with the target profile.

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/crm/_gfx/identities.drawio.svg" class="medium" alt="Moving identities and events when merging"><figcaption>Moving identities and events when merging</figcaption></figure>

The identities (UUIDs) can be found on the profile's card:

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/crm/_gfx/basic-profile-info.png" alt="Location of the Identities list on a profile's card" class="small" >
<figcaption>Location of the Identities list on a profile's card.</figcaption>
</figure>

## Properties, tags, and attributes

_Properties_ are the data stored **outside of the `attributes` object** of a profile's data:
`clientId, email, phone, customId, uuid, firstName, lastName, displayName, company, address, city, province, zipCode, countryCode, birthDate, sex, avatarUrl, anonymous, agreements (object), tags (list)`


_Attributes_ are the data stored in the `attributes` object.  
**When [non-unique emails](/docs/settings/configuration/non-unique-emails) are enabled, the profile's email and marketing agreement are attributes!**  
To see the properties and attributes of a profile, fetch its data with [`/v4/clients`](https://developers.synerise.com/ProfileManagement/ProfileManagement.html#operation/GetClientData).

When profiles are merged:
- All properties (including tags) of the source profiles are ignored and lost.
- If an attribute already exists in the target profile, it's not modified. In this case, attribute values from the source profiles are lost.  
- If an attribute from a source profile doesn't exist in the target profile, it's copied into the target profile.

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/crm/_gfx/merge-attributes.drawio.svg" class="medium" alt="Moving data when merging"><figcaption>Moving data when merging</figcaption></figure>

## Merging with customId


<div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

- This operation is **irreversible**. Use it carefully.
- The source profiles are **deleted**.
- Don't merge more than 20 accounts at once.

</div></div></div>


The following request merges profiles `lue42` and `mjz84` into a third profile: `tla114`.


<pre><code class="language-plaintext">curl --location --request POST \
'https://{SYNERISE_API_BASE_PATH}/v4/clients/merge/from/custom-ids/lue42,mjz84/to/custom-id/tla114' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Version: 4.4' \
--header 'Authorization: Bearer eyJh...ey4'</code></pre>


For more details, see the [API reference](https://developers.synerise.com/ClientManagement/ClientManagement.html#operation/MergeClientsByCustomId).

## Merging with clientId


<div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

- This operation is **irreversible**. Use it carefully.
- The source profiles are **deleted**.
- Don't merge more than 20 accounts at once.

</div></div></div>


The following request merges profiles `123` and `456` into a third profile: `789`.


<pre><code class="language-plaintext">curl --location --request POST \
'https://{SYNERISE_API_BASE_PATH}/v4/clients/merge/from/ids/123,456/to/id/789' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Version: 4.4' \
--header 'Authorization: Bearer eyJh...ey4'</code></pre>


For more details, see the [API reference](https://developers.synerise.com/ClientManagement/ClientManagement.html#operation/MergeClientsByClientId).