permissions

PATCH /files/{fileId}/permissions/{permissionId}

Changed on

Updates a permission with patch semantics. For more information, see Share files, folders, and drives. Warning: Concurrent permission modifications (such as update or delete) on the same file, folder, or shared drive aren't supported across any users or clients; only the last update is applied.

Request

  • Base URL
    https://www.googleapis.com/drive/v3
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/drive
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/drive
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/drive.file
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/drive.file

Path parameters

fileIdstring required

The ID of the file or shared drive.

permissionIdstring required

The ID of the permission.

Query parameters

enforceExpansiveAccessboolean

Deprecated: All requests use the expansive access rules.

removeExpirationboolean

Whether to remove the expiration date.

supportsAllDrivesboolean

Whether the requesting application supports both My Drives and shared drives.

supportsTeamDrivesboolean

Deprecated: Use supportsAllDrives instead.

transferOwnershipboolean

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. For more information, see Transfer file ownership.

useDomainAdminAccessboolean

Issue the request as a domain administrator. If set to true, and if the following additional conditions are met, the requester is granted access: 1. The file ID parameter refers to a shared drive. 2. The requester is an administrator of the domain to which the shared drive belongs. For more information, see Manage shared drives as domain administrators.

Request body

allowFileDiscoveryboolean

Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.

deletedboolean

Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type user or group.

displayNamestring

Output only. The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: * user - User's full name, as defined for their Google Account, such as "Dana A." * group - Name of the Google Group, such as "The Company Administrators." * domain - String domain name, such as "cymbalgroup.com." * anyone - No displayName is present.

domainstring

Output only. The domain to which this permission refers.

emailAddressstring

Output only. The email address of the user or group to which this permission refers.

expirationTimestring date-time

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

idstring

Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the User resource as permissionId. IDs should be treated as opaque values.

inheritedPermissionsDisabledboolean

When true, only organizers, owners, and users with permissions added directly on the item can access it.

kindstring

Output only. Identifies what kind of resource this is. Value: the fixed string "drive#permission".

pendingOwnerboolean

Whether the account associated with this permission is a pending owner. Only populated for permissions of type user for files that aren't in a shared drive.

photoLinkstring

Output only. A link to the user's profile photo, if available.

rolestring

The role granted by this permission. Supported values include: * owner * organizer * fileOrganizer * writer * commenter * reader For more information, see Roles and permissions.

typestring

The type of the grantee. Supported values include: * user * group * domain * anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. If type is domain, you must provide a domain. If type is anyone, no extra information is required.

viewstring

Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are published and metadata: * published: The permission's role is publishedReader. * metadata: The item is only visible to the metadata view because the item has limited access and the scope has at least read access to the parent. The metadata view is only supported on folders. For more information, see Views.

Response

Successful response

allowFileDiscoveryboolean

Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.

deletedboolean

Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type user or group.

displayNamestring

Output only. The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: * user - User's full name, as defined for their Google Account, such as "Dana A." * group - Name of the Google Group, such as "The Company Administrators." * domain - String domain name, such as "cymbalgroup.com." * anyone - No displayName is present.

domainstring

Output only. The domain to which this permission refers.

emailAddressstring

Output only. The email address of the user or group to which this permission refers.

expirationTimestring date-time

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

idstring

Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the User resource as permissionId. IDs should be treated as opaque values.

inheritedPermissionsDisabledboolean

When true, only organizers, owners, and users with permissions added directly on the item can access it.

kindstring

Output only. Identifies what kind of resource this is. Value: the fixed string "drive#permission".

pendingOwnerboolean

Whether the account associated with this permission is a pending owner. Only populated for permissions of type user for files that aren't in a shared drive.

photoLinkstring

Output only. A link to the user's profile photo, if available.

rolestring

The role granted by this permission. Supported values include: * owner * organizer * fileOrganizer * writer * commenter * reader For more information, see Roles and permissions.

typestring

The type of the grantee. Supported values include: * user * group * domain * anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. If type is domain, you must provide a domain. If type is anyone, no extra information is required.

viewstring

Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are published and metadata: * published: The permission's role is publishedReader. * metadata: The item is only visible to the metadata view because the item has limited access and the scope has at least read access to the parent. The metadata view is only supported on folders. For more information, see Views.

Changes

    • info

      the security scope https://www.googleapis.com/auth/drive was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/drive.file was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive.file was removed from the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/drive was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/drive.file was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive.file was removed from the endpoint's security scheme Oauth2c