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.
Request
API Version
v3- application/json
- Body
- Example (auto)
Bodyrequired
First name of the contact
Last name of the contact
Full name of the contact
Email address of the contact
Location Id the contact should be created under
Gender of the contact
Phone number of the contact
Street address of the contact
City of the contact
State of the contact
Postal code of the contact
Website URL of the contact
Timezone of the contact
Whether Do Not Disturb is enabled for the contact
Inbound DND settings per channel for the contact
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.
List of custom field values to assign to the contact
Source from which the contact was created
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
Country code of the contact (ISO 3166-1 alpha-2)
Company name of the contact
User's Id
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.
falsePer-channel DND settings for the contact
{
"firstName": "Rosan",
"lastName": "Deo",
"name": "Rosan Deo",
"locationId": "ve9EPM428h8vShlRW1KT",
"gender": "male",
"phone": "+1 888-888-8888",
"address1": "3535 1st St N",
"city": "Dolomite",
"state": "AL",
"postalCode": "35061",
"website": "https://www.tesla.com",
"timezone": "America/Chihuahua",
"dnd": true,
"inboundDndSettings": {
"all": {
"status": "active",
"message": "Do not contact me"
}
},
"tags": [
"nisi sint commodo amet",
"consequat"
],
"customFields": [
{
"id": "6dvNaf7VhkQ9snc5vnjJ",
"key": "my_custom_field",
"fieldValue": "My Text"
}
],
"source": "public api",
"dateOfBirth": "1990-09-25",
"country": "US",
"companyName": "DGS VolMAX",
"assignedTo": "y0BeYjuRIlDwsDcOHOJo",
"createNewIfDuplicateAllowed": false,
"dndSettings": {
"call": {
"status": "active",
"message": "Do not call"
},
"email": {
"status": "inactive"
}
}
}
Successful response
- application/json
- Schema
- Example (auto)
Schema
Whether a new contact was created (true) or an existing one was updated (false)
Contact details
Unique trace identifier for this operation
{
"new": true,
"contact": {
"id": "seD4PfOuKoVMLkEZqohJ",
"name": "rubika deo",
"locationId": "ve9EPM428h8vShlRW1KT"
},
"traceId": "abc123trace"
}