AI-generated Key Takeaways
-
Create up to 200 new contacts in a single batch request and receive PersonResponses for successful entries.
-
Specify a
readMask
to control the fields returned for each created contact or leave it empty to skip the post-mutate-get. -
Utilize the
ContactToCreate
object to define the person data for each new contact within the batch. -
Requires authorization with the
https://www.googleapis.com/auth/contacts
scope. -
Sequential requests for the same user are recommended to optimize performance and reliability.
Create a batch of new contacts and return the PersonResponses for the newly
Mutate requests for the same user should be sent sequentially to avoid increased latency and failures.
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 ( |
Fields | |
---|---|
contacts[] |
Required. The contact to create. Allows up to 200 contacts in a single request. |
readMask |
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:
|
sources[] |
Optional. A mask of what source types to return in the post mutate read. Defaults to |
Response body
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.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"createdPeople": [
{
object ( |
Fields | |
---|---|
createdPeople[] |
The contacts that were created, unless the request |
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 ( |
Fields | |
---|---|
contactPerson |
Required. The person data to populate a newly created source. |