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.
Gender of the contact. Before v4, Create, Update and Upsert accept it, and the contact returned by Get, lookup, duplicate search and the write responses includes it; Search results do not. Deprecated: from v4 on it is neither accepted nor returned, so store gender in a contact custom field instead.
Example:male
phonestringnullable
Phone number of the contact.
Phone numbers in phone and additionalPhones are saved in E.164 format, for example +14155550123. Send E.164 when you can. A number without a country code is read as a number in the country you send. If you do not send country, the contact's saved country is used on update, then the location's country, then US. Spaces, dashes and brackets are removed.
Example:+14155550123
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
postalCodestringnullable
Postal code of the contact. A number is saved as a string. On update, send null to remove it. An empty string leaves it unchanged.
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"}}
inboundDndSettings.allobject
Inbound DND settings applied to all channels
Example
{"status":"active","message":"Do not contact me"}
inboundDndSettings.all.statusstringrequired
Inbound DND status for this channel
Available optionsactiveinactive
Example:active
inboundDndSettings.all.messagestring
Custom message associated with the inbound DND setting
Example:Please do not contact me via this channel
tagsstring[]
Tags for the contact. When Upsert creates a contact, the contact gets these tags. When Upsert updates an existing contact, this list replaces all of the contact's tags: tags that are not in the list are removed, and an empty array removes every tag. Leave this field out to keep the current tags. Tag names are saved in lowercase, and a tag that does not exist in the location yet is created.
To add or remove tags without replacing the others, use Add Tags (POST /contacts/{contactId}/tags) or Remove Tags (DELETE /contacts/{contactId}/tags).
Example:["nisi sint commodo amet","consequat"]
customFieldsobject[]
List of custom field values to assign to the contact
Identifier of the custom field. Send id or key; when both are sent, id is used. On API version v4 and later an entry with neither returns 422; earlier versions skip that entry.
Example:6dvNaf7VhkQ9snc5vnjJ
customFields[].keystring
Key of the custom field (its fieldKey), used when id is not sent. Send id or key; when both are sent, id is used.
Example:my_custom_field
customFields[].fieldValuestring
Text value for the custom field (preferred format).
Example:My Text
customFields[].field_valuestringdeprecated
Deprecated. Use fieldValue instead.
Example: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
countrystringnullable
Country of the contact, as an ISO 3166-1 alpha-2 code, for example US or GB. The code is not case-sensitive, and the English country name (or UK) is also accepted. Either way, the upper-case code is saved. An empty string, or any other value, is rejected with 422. A phone number sent without a country code is read as a number in this country. When a contact is created without a country, the location's country is saved, or the agency's country if the location has none.
Example:US
companyNamestringnullable
Company name of the contact
Example:DGS VolMAX
assignedTostring
User's Id
Example:y0BeYjuRIlDwsDcOHOJo
createNewIfDuplicateAllowedboolean
Set to true to always create a new contact, without looking for an existing one. This works only at a location that allows duplicate contacts (the "Allow Duplicate Contact" setting).
true, and the location allows duplicate contacts: Upsert creates a new contact. It does not look for a matching contact.
true, and the location does not allow duplicate contacts: this field is ignored. Upsert looks for a matching contact, updates it if found, and creates a new contact if not.
false or not sent: Upsert looks for a matching contact, updates it if found, and creates a new contact if not. This is the same whether or not the location allows duplicate contacts.
See the Upsert Contact description for how a matching contact is found.
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 this Version, and capitalised keys such as Email are rejected with 422.
Channels you leave out keep their current status. The permanent status is normally set by the platform, for example after an SMS opt-out. Through this API:
Create Contact, and Upsert when it creates a contact, reject permanent on any channel with 401.
Update Contact, and Upsert when it updates a contact, can set email to permanent and can change a permanentemail back to active or inactive.
Changing sms or whatsApp to or from permanent returns 401. Changing call, gmb or fb to or from permanent returns 400.
Sending permanent for a channel that is already permanent is accepted. The status stays permanent, and the message and code of the channel are replaced with the values you send.
Example
{"call":{"status":"active","message":"Do not call"},"email":{"status":"inactive"}}
dndSettings.callobject
DND settings for phone calls
Example
{"status":"active","message":"Do not call","code":"all"}
dndSettings.call.statusstringrequired
Do Not Disturb status for this channel
Available optionsactiveinactivepermanent
Example:active
dndSettings.call.messagestring
Custom message associated with the DND setting
Example:Do not contact via this channel
dndSettings.call.codestring
DND code or reason
Example:OPTED_OUT
dndSettings.emailobject
DND settings for email
Example
{"status":"active","message":"Do not email","code":"all"}
dndSettings.email.statusstringrequired
Do Not Disturb status for this channel
Available optionsactiveinactivepermanent
Example:active
dndSettings.email.messagestring
Custom message associated with the DND setting
Example:Do not contact via this channel
dndSettings.email.codestring
DND code or reason
Example:OPTED_OUT
dndSettings.smsobject
DND settings for SMS
Example
{"status":"active","message":"Do not SMS","code":"all"}
dndSettings.sms.statusstringrequired
Do Not Disturb status for this channel
Available optionsactiveinactivepermanent
Example:active
dndSettings.sms.messagestring
Custom message associated with the DND setting
Example:Do not contact via this channel
dndSettings.sms.codestring
DND code or reason
Example:OPTED_OUT
dndSettings.whatsAppobject
DND settings for WhatsApp
Example
{"status":"active","message":"Do not WhatsApp","code":"all"}
dndSettings.whatsApp.statusstringrequired
Do Not Disturb status for this channel
Available optionsactiveinactivepermanent
Example:active
dndSettings.whatsApp.messagestring
Custom message associated with the DND setting
Example:Do not contact via this channel
dndSettings.whatsApp.codestring
DND code or reason
Example:OPTED_OUT
dndSettings.gmbobject
DND settings for Google My Business
Example
{"status":"active","message":"Do not contact via GMB","code":"all"}
dndSettings.gmb.statusstringrequired
Do Not Disturb status for this channel
Available optionsactiveinactivepermanent
Example:active
dndSettings.gmb.messagestring
Custom message associated with the DND setting
Example:Do not contact via this channel
dndSettings.gmb.codestring
DND code or reason
Example:OPTED_OUT
dndSettings.fbobject
DND settings for Facebook
Example
{"status":"active","message":"Do not contact via FB","code":"all"}
dndSettings.fb.statusstringrequired
Do Not Disturb status for this channel
Available optionsactiveinactivepermanent
Example:active
dndSettings.fb.messagestring
Custom message associated with the DND setting
Example:Do not contact via this channel
dndSettings.fb.codestring
DND code or reason
Example:OPTED_OUT
typestring
Contact type. One of the options of the location's Contact Type field (lead and customer by default), matched by option value or option name, ignoring case. When Upsert creates the contact, a value that is not sent or matches no option gives the contact the first option. When Upsert updates a contact, a value that matches no option does not change the contact's type.
Example:lead
Response
application/json
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.
newbooleanrequired
Whether a new contact was created (true) or an existing one was updated (false)
Global Do Not Disturb switch for all channels; omitted when never set (treat as false), and when true every channel is blocked irrespective of current dndSettings
Example:true
contact.typestring
Contact type. One of the options of the location's Contact Type field, lead or customer by default. A contact created without a matching type gets the first option, which is lead by default.
Example:lead
contact.sourcestring
Source from which the contact was created
Example:public api
contact.assignedTostring
User Id the contact is assigned to
Example:ve9EPM428h8vShlRW1KT
contact.address1string
Street address of the contact
Example:3535 1st St N
contact.citystring
City of the contact
Example:Birmingham
contact.statestring
State of the contact
Example:AL
contact.countrystring
Country of the contact
Example:US
contact.postalCodestring
Postal code of the contact
Example:35061
contact.websitestring
Website URL of the contact
Example:https://www.tesla.com
contact.tagsstring[]
List of tags associated with the contact
Example:["nisi sint commodo amet","consequat"]
contact.dateOfBirthstring
Date of birth of the contact (YYYY-MM-DD)
Example:1990-09-25
contact.dateAddedstringrequired
Date and time the contact was added (ISO 8601)
Example:2021-07-02T05:18:26.704Z
contact.dateUpdatedstring
Date and time the contact was last updated (ISO 8601)
Example:2021-07-02T05:18:26.704Z
contact.attachmentsstring[]deprecated
Deprecated: leftover field, not populated. Contact files are stored as documents on the contact, not here, so this is empty or absent (older records may still carry stale values). It is not part of the documented contact webhook payloads, but stale values on older records can still appear there. Do not rely on this field.
Example:[]
contact.ssnstring
Social Security Number (if applicable)
Example:123-45-6789
contact.genderstringdeprecated
Gender of the contact. Before v4, Create, Update and Upsert accept it, and the contact returned by Get, lookup, duplicate search and the write responses includes it; Search results do not. Deprecated: from v4 on it is neither accepted nor returned, so store gender in a contact custom field instead.
Example:male
contact.keywordstring
Search keyword associated with the contact
Example:test
contact.firstNameLowerCasestring
Lowercase version of the contact first name
Example:rubika
contact.fullNameLowerCasestring
Lowercase version of the contact full name
Example:rubika deo
contact.lastNameLowerCasestring
Lowercase version of the contact last name
Example:deo
contact.lastActivitystring
Date and time of last activity on this contact (ISO 8601)
Example:2021-07-16T11:39:30.564Z
contact.customFieldsobject[]required
Custom field values of the contact. Always returned; an empty array when the contact has no custom field values.
contact.customFields[].idstring
Unique identifier of the custom field
Example:6dvNaf7VhkQ9snc5vnjJ
contact.customFields[].valueobject
Value of the custom field. The data type depends on the field type, consistent with the request format:
String: Text, large text, single select, radio, phone, email, URL, date (YYYY-MM-DD), date and time, time, rich text, and a User field that allows one user (the user identifier).
Number: Numeric and monetary.
Array of strings: Checkbox, multi-select, and a User field that allows several users (user identifiers).
Object: File upload (see the file upload format in the request), and textbox list (option identifier to text).
Signature: the image URL as a string, or an object with the image URL in url.
Example:My Text
oneOf
string
number
string[]
object
string
contact.businessIdstring
Business Id the contact is associated with
Example:641c094001436dbc2081e642
contact.attributionSourceobject
First-touch attribution source details for the contact
Additional phone numbers associated with the contact
contact.additionalPhones[].phonestringrequired
Additional phone number of the contact
Example:+14155550124
contact.additionalPhones[].phoneLabelstring
Label
Available optionsHomeWorkMobileLandline
Example:Mobile
contact.visitorIdstring
visitorId is the Unique ID assigned to each Live chat visitor.
Example:ve9EPM428h8vShlRW1KT
contact.phoneLabelstring
Label for the primary phone number
Available optionsHomeWorkMobileLandline
Example:Mobile
contact.inboundDndSettingsobject
Do Not Disturb for inbound communication from the contact, independent of dnd and dndSettings; omitted when never set (treat as inactive), and when all is active inbound calls and SMS from the contact are blocked
Custom message associated with the inbound DND setting
Example:Please do not contact me via this channel
contact.reviewobject
Review request counters for the contact
contact.review.reviewEmailSentnumber
Number of review request emails sent to the contact
Example:1
contact.review.reviewSmsSentnumber
Number of review request SMS sent to the contact
Example:1
contact.scoringobject
Scores of the contact, one per score profile. Each key is the identifier of a score profile in the location, and each value is the contact's current score for it. Scores change when workflows or score profile rules add or subtract points, so a score can be negative. Absent when the contact has never been scored.
Where the contact came from when it was created by an import from another system: the import request, the app that ran it and the user who started it. Absent for contacts that were not imported. Treat it as read-only. Other keys can appear on contacts created before this format.
Identifier of the import request that created the contact
Example:6650f1c2a4b3c2d1e0f9a8b7
contact.externalImportMetaData.appIdstring
Identifier of the marketplace app that ran the import
Example:6650f1c2a4b3c2d1e0f9a8b6
contact.externalImportMetaData.appNamestring
Name of the app that ran the import
Example:HubSpot
contact.externalImportMetaData.userIdstring
Identifier of the user who started the import
Example:ve9EPM428h8vShlRW1KT
contact.skipEmailVerificationboolean
Whether email verification was skipped for this contact
Example:false
contact.dndSettingsobject
Per-channel DND settings; the object or a channel is omitted when never set (treat as inactive), and a channel is blocked when its status is active or permanent, or when dnd is true