Notice: important security update for Drive document URLs and resource keys. For more information, refer to Access link-shared files using resource keys

Permissions: update

Updates a permission with patch semantics. Try it now.

Request

HTTP request

PATCH https://www.googleapis.com/drive/v3/files/fileId/permissions/permissionId

Parameters

Parameter name Value Description
Path parameters
fileId string The ID of the file or shared drive.
permissionId string The ID of the permission.
Optional query parameters
fields string The paths of the fields you want included in the response. If not specified, the response includes a default set of fields specific to this method. For development you can use the special value * to return all fields, but you'll achieve greater performance by only selecting the fields you need. For more information, see Return specific fields for a file.
removeExpiration boolean Whether to remove the expiration date. (Default: false)
supportsAllDrives boolean Whether the requesting application supports both My Drives and shared drives. (Default: false)
supportsTeamDrives boolean Deprecated use supportsAllDrives instead. (Default: false)
transferOwnership boolean Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them. (Default: false)
useDomainAdminAccess boolean Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. (Default: false)

Authorization

This request requires authorization with at least one of the following scopes:

Scope
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

Some scopes are restricted and require a security assessment for your app to use them. For more information, see the authentication and authorization page.

Request body

In the request body, supply the relevant portions of a Permissions resource, according to the rules of patch semantics, with the following properties:

Property name Value Description Notes
Optional Properties
expirationTime datetime The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
  • They can only be set on user and group permissions
  • The time must be in the future
  • The time cannot be more than a year in the future
writable
pendingOwner boolean Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. writable
role string The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
  • owner
  • organizer
  • fileOrganizer
  • writer
  • commenter
  • reader
writable
view string Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. writable

Response

If successful, this method returns a Permissions resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.