AI-generated Key Takeaways
-
Modify the members of a contact group owned by the authenticated user using the
POSTmethod and providing resource names to add or remove. -
The request body should contain two optional fields:
resourceNamesToAddandresourceNamesToRemove, specifying the contact people to add or remove, respectively. -
The response body may include lists of
notFoundResourceNamesandcanNotRemoveLastContactGroupResourceNamesfor unsuccessful operations. -
Authorization requires the
https://www.googleapis.com/auth/contactsscope. -
System contact groups like
contactGroups/myContactsandcontactGroups/starredallow member addition, while others are deprecated and only support removal.
Modify the members of a contact group owned by the authenticated user.
The only system contact groups that can have members added are contactGroups/myContacts and contactGroups/starred. Other system contact groups are deprecated and can only have contacts removed.
HTTP request
POST https://people.googleapis.com/v1/{resourceName=contactGroups/*}/members:modify
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
resourceName |
Required. The resource name of the contact group to modify. |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "resourceNamesToAdd": [ string ], "resourceNamesToRemove": [ string ] } |
| Fields | |
|---|---|
resourceNamesToAdd[] |
Optional. The resource names of the contact people to add in the form of |
resourceNamesToRemove[] |
Optional. The resource names of the contact people to remove in the form of |
Response body
The response to a modify contact group members request.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "notFoundResourceNames": [ string ], "canNotRemoveLastContactGroupResourceNames": [ string ] } |
| Fields | |
|---|---|
notFoundResourceNames[] |
The contact people resource names that were not found. |
canNotRemoveLastContactGroupResourceNames[] |
The contact people resource names that cannot be removed from their last contact group. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/contacts
For more information, see the Authorization guide.