- Preview a contact merge
Preview the result of merging one contact into another without applying the merge. This is a read-only dry run: it reports whether the merge is allowed and, if so, exactly what would change, without modifying any data.
Send the same from and into contact IDs you would pass to Merge two contacts. As with the merge endpoint, from may have a role of lead or user, and into must have a role of user. You can optionally pass custom_attribute_names to include specific custom attributes in the previewed attribute changes.
- When
allowedistrue, the response contains asummary: every attribute change (with the resulting value on the surviving contact) and, for each object type, two counts —from, how many are on the source contact and would move to the destination, andinto, how many the destination already has. Counts are reported for conversations, tickets, phone calls, notes, and tags.conversationscounts non-ticket conversations only; tickets are reported separately undertickets, andphone_callsis present only for phone-channel merges. - When
allowedisfalse, the response containsreasons. Each reason has a stablecodeyou can branch on and a human-readablemessageyou can display.
By default a merge requires the two contacts to share an identifier (email or phone). Set skip_duplicate_validation to true to preview a merge of contacts that don't, the same rule the merge endpoint enforces.
When allowed is false, reasons[].code is one of:
| code | meaning |
|---|---|
source_same_as_target | The source contact (from) and the destination contact (into) are the same contact. A contact can't be merged into itself. |
invalid_merge_role_pair | The from/into roles aren't mergeable. into must be a user. |
no_shared_identifier | The contacts share no email or phone. Set skip_duplicate_validation to preview anyway. |
facebook_user | Facebook contacts can't be merged. |
external_lead_channel_not_allowed | The source is an external-channel lead that isn't eligible for merging. |
mailing_list | Contacts created from a mailing list can't be merged. |
user_to_lead | into is a lead or visitor. A user can only be merged into another user. |
whatsapp_data_cannot_be_merged | The WhatsApp number on the source contact can't be reassigned to the destination. |
telegram_data_cannot_be_merged | The Telegram sender on the source contact can't be reassigned to the destination. |
source_has_telegram_data | The source contact has Telegram data, which user-into-user merges don't yet support moving. |
phone_data_cannot_be_merged | The phone data on the source contact can't be reassigned to the destination. |
Intercom API version.
By default, it's equal to the version set in the app package.
The unique identifier for the contact to merge away from (the source contact). Can have a role of lead or user.
The unique identifier for the contact to merge into (the destination contact). Must have a role of user.
When true, previews the merge even if the contacts don't share a common identifier. Must be a JSON boolean; the string "true" does not bypass the check. Defaults to false.
- The production API serverhttps://api.intercom.io/contacts/merge/preview
- The european API serverhttps://api.eu.intercom.io/contacts/merge/preview
- The australian API serverhttps://api.au.intercom.io/contacts/merge/preview
curl -i -X POST \
https://api.intercom.io/contacts/merge/preview \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'Intercom-Version: Preview' \
-d '{
"from": "6762f0d51bb69f9f2193bb7f",
"into": "6762f0d51bb69f9f2193bb80"
}'successful
Returned when the merge is allowed.
A summary of the changes the merge would make to the surviving contact.
- Merge preview allowed
- Merge preview not allowed
- Merge allowed
- Merge not allowed
{ "allowed": true, "summary": { "attribute_changes": { … }, "reassignments": { … } } }