post https://api.whippy.co/v1/contacts/merge_contacts
Merges two contacts into one.
-
Parameters:
from_contact_id
- the ID of the contact to be merged into the main contact.to_contact_id
- the ID of the contact in which the merge will be performed.
-
Once merged, the
from_contact
will have:- its
email
andphone
fields set tonull
- its
state
value set tomerged
- will no longer be accessible/visible/usabl (as its information will now belong to the
to_contact
).
- its
-
The
to_contact
will have:- its
email
andphone
fields set to the values of thefrom_contact
if they are notnull
. Otherwise, it will keep its current values.
- its
-
Many records in related tables are inherited, merged, overwritten, deleted or updated based during the merge process.
-
Conversations, Messages, Message Attachments, Contact Events, Conversation Events:
email
conversations are inherited by theto_contact
.phone
conversations:- are inherited by the
to_contact
for channels it doesn't already have conversations with. - have their messages and attachments transferred to the corresponding existing conversation for every channel it already has conversation on.
- are inherited by the
whatsapp
conversations follow the same rules asphone
conversations.- All Scheduled Message Jobs for the inherited messages are deleted.
- All Contact Events are inherited by the
to_contact
. - All Conversation Events are inherited by the
to_contact
(and shown in the respective conversation).
-
Communication Preference:
- if
from_contact
doesn't have preferences,to_contact
's preferences remain unchanged. - if
from_contact
has preferences,to_contact
loses its current ones and inheritsfrom_contact
's.
- if
-
Conversation Agent Session:
- All currently existing agent sessions
to_contact
has remain unchanged. - All new ones are inherited by
to_contact
's respective conversations.
- All currently existing agent sessions
-
Contact Integration:
- All are inherited by
to_contact
.
- All are inherited by
-
Contact Tag:
- Any currently existing tags
tocontact
has remain unchanged. - All new tags are inherited by
to_contact
.
- Any currently existing tags
-
Note:
- Any currently existing notes
to_contact
has remain unchanged. - All new notes are inherited by
to_contact
.
- Any currently existing notes
-
Any existing data related to Sequence Runs, Steps, Campaigns that
from_contact
has is updated to point to theto_contact
respectively (as it's the inheritor offrom_contact
). -
No other information(data) is moved/merged/inherited by the
to_contact
.
-
Callback