v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-136454227.5 KB
permissions

Updates a permission with patch semantics. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren't supported; only the last update is applied.

patch/files/{fileId}/permissions/{permissionId}

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.

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.

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

photoLinkstring

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

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".

domainstring

Output only. The domain to which this permission refers.

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.

emailAddressstring

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

rolestring

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

deletedboolean

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

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.

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.

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.

Response

Successful response