Skip to main content
ContactsVersion: v3New

Upsert Contact

POST/contacts/upsert

The Upsert API will adhere to the configuration defined under the "Allow Duplicate Contact" setting at the Location level. If the setting is configured to check both Email and Phone, the API will attempt to identify an existing contact based on the priority sequence specified in the setting, and will create or update the contact accordingly.

If two separate contacts already exist—one with the same email and another with the same phone—and an upsert request includes both the email and phone, the API will update the contact that matches the first field in the configured sequence, and ignore the second field to prevent duplication.

Idempotency-Key is not supported. Upsert matches an existing contact by email or phone as described above, so for requests that include an email or phone it is safer to retry than Create Contact. This does not apply when createNewIfDuplicateAllowed is set at a location that allows duplicates.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your access token.

Scope:contacts.write
Auth methods:OAuthPrivate Integration
Token type:Sub-Account Token

Request​

Headers

Versionstringrequired

API Version. Send v3.

Available optionsv3
Example:v3

Body

firstNamestringnullable

First name of the contact

Example:Rosan
lastNamestringnullable

Last name of the contact

Example:Deo
namestringnullable

Full name of the contact

Example:Rosan Deo
emailstringnullable

Email address of the contact

locationIdstringrequired

Location Id the contact should be created under

Example:ve9EPM428h8vShlRW1KT
genderstring

Gender of the contact

Example:male
phonestringnullable

Phone number of the contact

Example:+1 888-888-8888
address1stringnullable

Street address of the contact

Example:3535 1st St N
citystringnullable

City of the contact

Example:Dolomite
statestringnullable

State of the contact

Example:AL
postalCodestring

Postal code of the contact

Example:35061
websitestringnullable

Website URL of the contact

Example:https://www.tesla.com
timezonestringnullable

Timezone of the contact

Example:America/Chihuahua
dndboolean

Global Do Not Disturb switch for all channels; true blocks every channel irrespective of current dndSettings, and it does not add or change any dndSettings entry

Example:true
inboundDndSettingsobject

Do Not Disturb for inbound communication from the contact, independent of dnd and dndSettings; only the all key is accepted, with status active or inactive, and any other key is rejected with 422

Example
{
  "all": {
    "status": "active",
    "message": "Do not contact me"
  }
}
tagsstring[]

This field will overwrite all current tags associated with the contact. To update a tags, it is recommended to use the Add Tag or Remove Tag API instead.

Example:["nisi sint commodo amet","consequat"]
customFieldsobject[]

List of custom field values to assign to the contact

Example
[
  {
    "id": "6dvNaf7VhkQ9snc5vnjJ",
    "key": "my_custom_field",
    "fieldValue": "My Text"
  }
]
sourcestring

Source from which the contact was created

Example:public api
dateOfBirthstringnullable

The birth date of the contact. Supported formats: YYYY/MM/DD, MM/DD/YYYY, YYYY-MM-DD, MM-DD-YYYY, YYYY.MM.DD, MM.DD.YYYY, YYYY_MM_DD, MM_DD_YYYY

Example:1990-09-25
countrystring

Country code of the contact (ISO 3166-1 alpha-2)

Example:US
companyNamestringnullable

Company name of the contact

Example:DGS VolMAX
assignedTostring

User's Id

Example:y0BeYjuRIlDwsDcOHOJo
createNewIfDuplicateAllowedboolean

Controls whether to create a new contact or update an existing duplicate. Scenario 1: If this value is true and the location allows duplicate contacts, a new contact will be created immediately without checking for duplicates. Scenario 2: If this value is true but the location does not allow duplicate contacts, this field is ignored and the normal upsert behavior applies: the API will search for an existing duplicate contact, update it if found, or create a new contact if not found. Scenario 3: If this value is false or not provided, the normal upsert behavior applies regardless of the location's duplicate contact setting.

Default:false
Example:false
dndSettingsobject

Per-channel DND settings, independent of the global dnd switch; channel keys are call, email, sms, whatsApp, gmb and fb on Version v3 and later, and Email-style keys are rejected with 422

Example
{
  "call": {
    "status": "active",
    "message": "Do not call"
  },
  "email": {
    "status": "inactive"
  }
}

Response

Successful response. Upsert returns 201 for both outcomes: when it creates a new contact and when it matches or updates an existing one. Use the new field to tell them apart: true means a contact was created, false means an existing contact was used.

newboolean

Whether a new contact was created (true) or an existing one was updated (false)

Example:true
contactobject

Contact details

traceIdstring

Unique trace identifier for this operation

Example:abc123trace