Method: people.batchCreateContacts

Create a batch of new contacts and return the PersonResponses for the newly created contacts. Limited to 10 parallel requests per user.

HTTP request

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

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

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

object (ContactToCreate)

Required. The contact to create. Allows up to 200 contacts in a single request.

readMask

string (FieldMask format)

Required. A field mask to restrict which fields on each person are returned in the response. 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 in the post mutate read. 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 BatchCreateContactsErrorDetails which contains a list of errors for each invalid contact.

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

JSON representation
{
  "createdPeople": [
    {
      object (PersonResponse)
    }
  ]
}
Fields
createdPeople[]

object (PersonResponse)

The contacts that were created, unless the request readMask is empty.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authorization guide.

ContactToCreate

A wrapper that contains the person data to populate a newly created source.

JSON representation
{
  "contactPerson": {
    object (Person)
  }
}
Fields
contactPerson

object (Person)

Required. The person data to populate a newly created source.