Method: people.updateContact
Stay organized with collections
Save and categorize content based on your preferences.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-13 UTC."],[[["\u003cp\u003eUpdates contact data for an existing contact person, replacing specified fields with new values.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying \u003ccode\u003eupdatePersonFields\u003c/code\u003e to indicate which fields to update and \u003ccode\u003eperson.metadata.sources\u003c/code\u003e for identification.\u003c/p\u003e\n"],["\u003cp\u003eReturns a 400 error if there are inconsistencies with the contact's data or issues with the provided update information, like missing contact groups when updating memberships.\u003c/p\u003e\n"],["\u003cp\u003eEnforces limitations on updating specific singleton fields within contact sources, ensuring data integrity.\u003c/p\u003e\n"],["\u003cp\u003eSuggests sending mutate requests sequentially to prevent latency and failures when updating the same user.\u003c/p\u003e\n"]]],["This content describes updating contact data via a PATCH request to `https://people.googleapis.com/v1/{person.resourceName=people/*}:updateContact`. The `person.resourceName` path parameter specifies the contact. The `updatePersonFields` query parameter details which fields to update. The request body contains the updated contact `Person` data. The server returns a `400` error for missing sources, mismatched etags, or updating singletons improperly. The response body, on success, contains the updated `Person` resource. `Authorization` scope `https://www.googleapis.com/auth/contacts` is required.\n"],null,["# Method: people.updateContact\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdate contact data for an existing contact person. Any non-contact data will not be modified. Any non-contact data in the person to update will be ignored. All fields specified in the `updateMask` will be replaced.\n\nThe server returns a 400 error if `person.metadata.sources` is not specified for the contact to be updated or if there is no contact source.\n\nThe server returns a 400 error with reason `\"failedPrecondition\"` if `person.metadata.sources.etag` is different than the contact's etag, which indicates the contact has changed since its data was read. Clients should get the latest person and merge their updates into the latest person. If making sequential updates to the same person, the etag from the `updateContact` response should be used to avoid failures.\n\nThe server returns a 400 error if `memberships` are being updated and there are no contact group memberships specified on the person.\n\nThe server returns a 400 error if more than one field is specified on a field that is a singleton for contact sources:\n\n- biographies\n- birthdays\n- genders\n- names\n\nMutate requests for the same user should be sent sequentially to avoid increased latency and failures.\n\n### HTTP request\n\n`PATCH https://people.googleapis.com/v1/{person.resourceName=people/*}:updateContact`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------------------|-------------------------------------------------------------------------------------------------------------------------|\n| `person.resourceName` | `string` The resource name for the person, assigned by the server. An ASCII string in the form of `people/{person_id}`. |\n\n### Query parameters\n\n| Parameters ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updatePersonFields` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.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 updated fields will be replaced. 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 |\n| `personFields` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` Optional. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Defaults to all fields if not set. 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 |\n| `sources[]` | `enum (`[ReadSourceType](/people/api/rest/v1/ReadSourceType)`)` Optional. A mask of what source types to return. Defaults to [READ_SOURCE_TYPE_CONTACT](/people/api/rest/v1/ReadSourceType#ENUM_VALUES.READ_SOURCE_TYPE_CONTACT) and [READ_SOURCE_TYPE_PROFILE](/people/api/rest/v1/ReadSourceType#ENUM_VALUES.READ_SOURCE_TYPE_PROFILE) if not set. |\n\n### Request body\n\nThe request body contains an instance of [Person](/people/api/rest/v1/people#Person).\n\n### Response body\n\nIf successful, the response body contains an instance of [Person](/people/api/rest/v1/people#Person).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/contacts`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]