Upsert Contacts

Bulk creates or updates contacts in an organization.

Optionally, it can opt in contacts to all organization channels or specific channels. Also, the contacts in the list can optionally be associated with a custom object by providing the custom object ID in the top level of the request body and the properties of the custom object in the properties key of each contact. А contact's relationship with a custom object is always one-to-one.

Important: The following fields of a contact are unique and also nullable:

  • external_id
  • phone
  • email

This means that if a contact with the same value for any of these fields already exists in the organization, the contact will be updated instead of created. The following update strategy is applied:

  • If a contact is present in the payload where the external_id conflicts with the external_id of an existing contact:
    • If the existing contact has a different email and phone than the new contact, the existing contact will be updated with the new data and the email and phone will be overwritten, as long as no other contact has the same email or phone.
  • If a contact is present in the payload where the phone conflicts with the phone of an existing contact:
    • If the existing contact has the same external_id as the new contact or its value is not set, the existing contact will be updated with the new data.
    • If the existing contact has a different external_id than the new contact, a new contact without a phone will be created.
  • If a contact is present in the payload where the email conflicts with the email of an existing contact:
    • If the existing contact has the same external_id and phone as the new contact or their values are not set, the existing contact will be updated with the new data.
    • If the existing contact has a different external_id and phone than the new contact, a new contact without an email will be created.
Body Params

Contact Upsert

contacts
array of objects
required
length between 1 and 4000

List of contacts that would comprise the contact list

contacts*
address
object

Optional Address details of the Contact

birth_date
object

Birthday details of the Contact.

uuid

The ID of the channel from which the contact should receive messages by default.

string
length ≤ 255

Contact email

string

The external ID of a contact. It uniquely identifies a contact and can be useful for associating whippy contacts with external systems.

string

The language preference of the Contact

string
length ≤ 255

Contact name

string

Contact phone number

properties
object

Contact properties mapped to custom data. These properties are mapped to the custom object in the payload.

The properties keys should correspond to the keys of the custom properties that belong to the custom object.

custom_data
object

An object containing the ID of the custom object with which the contact should be associated. The resource should always be contact.

opt_in_to
array of objects
length between 1 and 1000

Setting to opt in contacts from contacts param to specific channels

opt_in_to
string

Channel ID

string

Channel phone number

boolean
Defaults to true

Setting to opt in contacts from contacts param to all organization channels

Responses

Callback
Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json