> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lemlist.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Merges up to 10 lemlist contacts into one survivor, moving everything attached to the deleted contacts onto it.

# Merge contacts

Merges up to 10 lemlist contacts into one. The survivor (`primaryId`) keeps its id and every value it holds; its **empty** fields are filled from the other contacts, which are then deleted. A value the survivor already has is never overwritten.

**Email addresses** follow the same rule: the survivor keeps its own, a loser's addresses are dropped — unless the survivor has none, in which case it takes the first loser's.

Each contact is addressed by its lemlist id (`ctc_xxx`) or by one of its email addresses, like `DELETE /contacts/{idOrEmail}`. The response always carries the resolved `primaryId`.

## What moves to the survivor

* Leads in campaigns, activities, tasks, list memberships and inbox conversations of every deleted contact.
* When a CRM is connected, the survivor keeps its CRM link, or adopts the first linked contact's when it has none, and receives the merged values there. lemlist never merges or deletes anything in the CRM itself: the other contacts' CRM records stay in the CRM, unlinked from lemlist. Merge them CRM-side too, or a later CRM import may recreate the duplicate.

## Partial runs — `success: true` does not mean complete

The contacts are folded into the survivor one at a time and the run **stops at the first failure**. The response is still `200`: `mergedIds` lists what went through, `remainingIds` what still exists — fix the cause (typically an enrichment in progress) and call again with the remaining ids. A failure on the very first fold returns an error instead, and nothing was written.

<Warning>
  There is no undo. Once merged, the secondary contacts are deleted and only the survivor remains.
</Warning>
