Update Contacts (Batch)

Update/Modify the properties of a contacts within an organization.

❗️

This is NOT a partial update

This API should not be used to update the contact unless you have the entire contact object. For partial update see (Update Contact Partially). Any node not specified in the payload will be removed from the contact.

This API method cannot be used to remove a contact from a group

🚧

Tips and tricks

  • Use this call to add/update existing contacts, use DELETE /groups/{organizationId}/ contacts to delete a contact from a group.
  • Including the ID field in the request body is ignored. The contact to update is specified by the {contactId} given on the URI.
  • Update the externalId value even if that's what you're using to identify the contact to update.
  • Specifying an external ID in the request body that is different that the URI will attempt to update the contact's external ID.
    • If the external ID value is already in the database, an error will be returned.
  • Omitting a field entirely will update the missing field to be empty (for all non-array
    based fields).
  • For contactAttributes, omitting one of the array elements will clear that one value. Omitting the entire contactAttributes, field will clear all additional information for that contact.
  • For topic (subscriptions) omit IDs to remove, or omit the entire field to remove all topics.
  • For addresses, omit a single one to remove it, or omit the entire addresses field to
    remove all addresses.
    • For an address to show up on the map, you must include GIS coordinates.

NOTE:

  1. This API method cannot be used to remove a contact from a group
  2. Omitting a field from the request body will delete the value from the contact. Refer request example Basic request to update Contact. In that example, every single value field on the record, except for the four field specified, would be deleted.

Using Name to Identify ID Feature

Some name fields can be used to identify ID. If both exist, the id is high priority.

recordTypeId and recordTypeName

Expand for recordTypeName examples

There is a contact record type:
id: 1533823015714817 name: Employee
Examples:

{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817
}

Below request also work well.
{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeName": "Employee"
}

groups and groupsName

Expand for groupsName examples

There are some groups:
id: 1 name: group1
id: 2 name: group2
id: 3 name: group3
Examples:

{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817,
    "groups": [
        1,
        2,
        3
    ]
}

Below request also work well.
{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817,
    "groupsName": [
        "group1",
        "group2",
        "group3"
    ]
}

Contact Attributes: orgAttrId and name

Expand for Contact Attributes examples

There is a Contact Attribute:

{
    "id": 1509768514502692,
    "name": "attr1",
    "dataType": "STRING",
    "definedValues": [
        "option1",
        "option2",
        "option3"
    ],
    "displayFormat": "S"
}

Examples:

{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817,
    "contactAttributes": [
        {
            "orgAttrId": 1509768514502692,
            "name": "attr1",
            "values": [
              "option1",
              "option2"
            ]
        }
    ]
}

Below request also work well.
{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817,
    "contactAttributes": [
        {
            "name": "attr1",
            "values": [
              "option1",
              "option2"
            ]
        }
    ]
}

Contact Path: pathId and prompt

Expand for Contact Path examples

There is a phone contact path:

{
    "pathId": 241901148045319,
    "prompt": "phone"
}

Examples:

{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817,
    "paths": [
        {
            "pathId": 241901148045319,
            "countryCode": "CN",
            "value": "17525889654"
        }
    ]
}

Below request also work well.
{
    "firstName": "F",
    "lastName": "L",
    "externalId": "001",
    "recordTypeId": 1533823015714817,
    "paths": [
        {
            "prompt": "phone",
            "countryCode": "CN",
            "value": "17525889654"
        }
    ]
}

The following APIs can be used to find the IDs of resources used for updating Contact:

  • paths: pathId-List Contact Paths
  • contactAttributes: Coming soon
  • groups: Coming soon
  • accountId: Coming soon

Request body

PropertyDescription
pathAn array of delivery paths. The order specified will be the order of preference.
pathId: List Contact Paths
{ "pathId":"{List Contact Paths}", "countryCode": "{delivery path value}", "value": "{ISO country code}" }

For quietTimeFrames of path, if quietTimeFrames is present, timezoneId is required

1. days: it is a list, where 1 stands for Sunday, 2 stands for Monday, and so on, 7 is for Saturday. Say Monday and Friday are selected. In DB it is like [2,6]

2. fromHour/toHour: presents in 24-hour clock; for example, 23 is for 11PM

3. fromMin/toMin: from 0 to 59

Something special for the update,

1. If quietTimeFrames is none empty value, quietTimeFrames for the path will be updated with the value.

2. If quietTimeFrames is not present, quietTimeFrames for the path will not be updated. In DB, it keeps the settings with no change

3. If quietTimeFrames is not present, quietTimeFrames for the path will not be updated. In DB, it keeps the settings with no change.

Error Messages

statusmessage
300The externalId recordType not found in org.
401Missing Organization Id
404Missing Contact Id
Language
Credentials
URL
Click Try It! to start a request and see the response here!