Update an existing Permission on an Item. Only the role
property can be
modified.
PATCH /drive/items/{item-id}/permissions/{permission-id}
PATCH /drive/root/:{item-path}:/permissions/{permission-id}
None.
In the request body, supply the values for the new role
.
Name | Value | Description |
---|---|---|
if-match |
etag |
If this request header is included and the etag provided does not match the current etag on the file, an 412 Precondition Failed response is returned. |
The following example updates the Permission resource to a read-only permission.
PATCH /drive/items/{item-id}/permissions/{permission-id}
Content-Type: application/json
{
"roles": ["read"]
}
If successful, this method returns a Permission resource in the response body that represents the updated state of the permission.
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "123",
"roles": ["read"],
"grantedTo": {
"user": {
"id": "5D33DD65C6932946",
"displayName": "John Doe"
}
}
}
Note: Response object is truncated for clarity. All default properties will be returned from the actual call.
Read the Error Responses topic for more information about how errors are returned.