Upserts a single contact: the endpoint looks for an existing contact, updates it when one is found, and creates it otherwise. A contact array holding more than one resource is rejected.
The lookup runs in this order:
- Contact id, only when the request is sent with
lookupByAcId=trueandcontact.idis set. An id that resolves to nothing does not fail the request; the lookup carries on with the checks below. contact.whatsapp_id, when WhatsApp contacts are enabled for the account. If no contact has the WhatsApp id andcontact.emailwas sent too, the email is tried as a fallback so a duplicate contact is not created for an email that already exists.contact.email, when nocontact.whatsapp_idwas sent. An email that matches nothing never falls back to the phone number.contact.phone, only when no email was sent at all. A phone number that more than one contact has is rejected withPhone must be unique when there is no email.
Creating a contact needs the pg_subscriber_add permission and updating one needs pg_subscriber_edit, so the permission a request needs depends on whether the lookup found a contact. Contacts without an email address require phone-only contacts to be enabled for the account and contact.allowNullEmail to be set, and WhatsApp payloads require WhatsApp contacts to be enabled.
ip4 records the IPv4 address the contact opted in from, on the contact and on the list memberships this call creates. Only IPv4 is accepted.
Each lists entry may carry an sdate subscribe date and the mail subscribing should send: sendInstantAutoresponder, suppressInstantAutoresponder and sendLastCampaign. An entry only accepts those keys plus list, and asking for the autoresponders and their suppression at once is rejected.
form attributes the write to a form and inherits that form's behaviour: the lists it subscribes to (on top of the lists named here), its double opt-in confirmation — which leaves a membership it creates unconfirmed until the contact confirms — its actions and its submit automation trigger. A form ID that does not exist is rejected.
Organization-Related Nodes Have Been DeprecatedContact-Organization relationships are now managed through Account-Contact end points
/sync "upserts" Contact dataThe Contact record to be updated is identified by the
If the
{
"contact": {
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"phone": "7223224241",
"fieldValues": [
{
"field": "1",
"value": "The Value for First Field"
},
{
"field": "6",
"value": "2008-01-20"
}
],
"tags": [
"customer",
"newsletter"
]
}
}{
"fieldValues": [
{
"contact": "113",
"field": "1",
"value": "The Value for First Field",
"cdate": "2020-08-01T10:54:59-05:00",
"udate": "2020-08-01T14:13:34-05:00",
"links": {
"owner": "https://:account.api-us1.com/api/3/fieldValues/11797/owner",
"field": "https://:account.api-us1.com/api/3/fieldValues/11797/field"
},
"id": "11797",
"owner": "115"
},
{
"contact": "113",
"field": "6",
"value": "2008-01-20",
"cdate": "2020-08-01T10:54:59-05:00",
"udate": "2020-08-01T14:13:34-05:00",
"links": {
"owner": "https://:account.api-us1.com/api/3/fieldValues/11798/owner",
"field": "https://:account.api-us1.com/api/3/fieldValues/11798/field"
},
"id": "11798",
"owner": "115"
}
],
"contact": {
"cdate": "2018-09-28T17:27:21-05:00",
"email": "[email protected]",
"phone": "7223224241",
"firstName": "John",
"lastName": "Doe",
"orgid": "0",
"segmentio_id": "",
"bounced_hard": "0",
"bounced_soft": "0",
"bounced_date": "0000-00-00",
"ip": "0",
"ua": "",
"hash": "",
"socialdata_lastcheck": "0000-00-00 00:00:00",
"email_local": "",
"email_domain": "",
"sentcnt": "0",
"rating_tstamp": "0000-00-00",
"gravatar": "0",
"deleted": "0",
"anonymized": "0",
"udate": "2018-09-28T17:30:52-05:00",
"deleted_at": "0000-00-00 00:00:00",
"created_utc_timestamp": "2018-09-28 17:27:21",
"updated_utc_timestamp": "2018-09-28 17:27:21",
"links": {
"bounceLogs": "https://:account.api-us1.com/api/3/contacts/115/bounceLogs",
"contactAutomations": "https://:account.api-us1.com/api/3/contacts/115/contactAutomations",
"contactData": "https://:account.api-us1.com/api/3/contacts/115/contactData",
"contactGoals": "https://:account.api-us1.com/api/3/contacts/115/contactGoals",
"contactLists": "https://:account.api-us1.com/api/3/contacts/115/contactLists",
"contactLogs": "https://:account.api-us1.com/api/3/contacts/115/contactLogs",
"contactTags": "https://:account.api-us1.com/api/3/contacts/115/contactTags",
"contactDeals": "https://:account.api-us1.com/api/3/contacts/115/contactDeals",
"deals": "https://:account.api-us1.com/api/3/contacts/115/deals",
"fieldValues": "https://:account.api-us1.com/api/3/contacts/115/fieldValues",
"geoIps": "https://:account.api-us1.com/api/3/contacts/115/geoIps",
"notes": "https://:account.api-us1.com/api/3/contacts/115/notes",
"organization": "https://:account.api-us1.com/api/3/contacts/115/organization",
"plusAppend": "https://:account.api-us1.com/api/3/contacts/115/plusAppend",
"trackingLogs": "https://:account.api-us1.com/api/3/contacts/115/trackingLogs",
"scoreValues": "https://:account.api-us1.com/api/3/contacts/115/scoreValues"
},
"id": "115",
"organization": null
}
}