Method: people.batchUpdateContacts

Update a batch of contacts and return a map of resource names to PersonResponses for the updated contacts. Limited to 10 parallel requests per user.

HTTP request

POST https://people.googleapis.com/v1/people:batchUpdateContacts

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "contacts": {
    string: {
      object (Person)
    },
    ...
  },
  "updateMask": string,
  "readMask": string,
  "sources": [
    enum (ReadSourceType)
  ]
}
Fields
contacts

map (key: string, value: object (Person))

Required. A map of resource names to the person data to be updated. Allows up to 200 contacts in a single request.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

updateMask

string (FieldMask format)

Required. A field mask to restrict which fields on the person are updated. Multiple fields can be specified by separating them with commas. All specified fields will be replaced, or cleared if left empty for each person. Valid values are:

  • addresses
  • biographies
  • birthdays
  • calendarUrls
  • clientData
  • emailAddresses
  • events
  • externalIds
  • genders
  • imClients
  • interests
  • locales
  • locations
  • memberships
  • miscKeywords
  • names
  • nicknames
  • occupations
  • organizations
  • phoneNumbers
  • relations
  • sipAddresses
  • urls
  • userDefined
readMask

string (FieldMask format)

Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. If read mask is left empty, the post-mutate-get is skipped and no data will be returned in the response. Valid values are:

  • addresses
  • ageRanges
  • biographies
  • birthdays
  • calendarUrls
  • clientData
  • coverPhotos
  • emailAddresses
  • events
  • externalIds
  • genders
  • imClients
  • interests
  • locales
  • locations
  • memberships
  • metadata
  • miscKeywords
  • names
  • nicknames
  • occupations
  • organizations
  • phoneNumbers
  • photos
  • relations
  • sipAddresses
  • skills
  • urls
  • userDefined
sources[]

enum (ReadSourceType)

Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set.

Response body

If successful, the response body contains data with the following structure:

If not successful, returns BatchUpdateContactsErrorDetails, a list of errors corresponding to each contact.

The response to a request to update a batch of contacts.

JSON representation
{
  "updateResult": {
    string: {
      object (PersonResponse)
    },
    ...
  }
}
Fields
updateResult

map (key: string, value: object (PersonResponse))

A map of resource names to the contacts that were updated, unless the request readMask is empty.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/contacts

For more information, see the Authorization guide.