Update a permission
PATCH {{baseUrl}}/files/:fileId/permissions/:permissionId?key={{key}}&oauth_token={{oauthToken}}
Updates a permission with patch semantics.
Warning:ย Concurrent permissions operations on the same file are not supported; only the last update is applied.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
removeExpiration | string | Whether to remove the expiration date. | |
supportsAllDrives | string | Whether the requesting application supports both My Drives and shared drives. | |
supportsTeamDrives | string | Deprecated use supportsAllDrives instead. | |
transferOwnership | string | 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. | |
useDomainAdminAccess | string | 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. | |
alt | string | Data format for the response. | |
fields | string | Selector specifying which fields to include in a partial response. | |
key | string | API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. | |
oauth_token | string | OAuth 2.0 token for the current user. | |
prettyPrint | string | Returns response with indentations and line breaks. | |
quotaUser | string | An opaque string that represents a user for quota purposes. Must not exceed 40 characters. | |
userIp | string | Deprecated. Please use quotaUser instead. |
Request Body
{"allowFileDiscovery"=>"<boolean>", "deleted"=>"<boolean>", "displayName"=>"<string>", "domain"=>"<string>", "emailAddress"=>"<string>", "expirationTime"=>"<dateTime>", "id"=>"<string>", "kind"=>"drive#permission", "pendingOwner"=>"<boolean>", "permissionDetails"=>[{"inherited"=>"<boolean>", "inheritedFrom"=>"<string>", "permissionType"=>"<string>", "role"=>"<string>"}, {"inherited"=>"<boolean>", "inheritedFrom"=>"<string>", "permissionType"=>"<string>", "role"=>"<string>"}], "photoLink"=>"<string>", "role"=>"<string>", "teamDrivePermissionDetails"=>[{"inherited"=>"<boolean>", "inheritedFrom"=>"<string>", "role"=>"<string>", "teamDrivePermissionType"=>"<string>"}, {"inherited"=>"<boolean>", "inheritedFrom"=>"<string>", "role"=>"<string>", "teamDrivePermissionType"=>"<string>"}], "type"=>"<string>", "view"=>"<string>"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"allowFileDiscovery":"\u003cboolean\u003e","deleted":"\u003cboolean\u003e","displayName":"\u003cstring\u003e","domain":"\u003cstring\u003e","emailAddress":"\u003cstring\u003e","expirationTime":"\u003cdateTime\u003e","id":"\u003cstring\u003e","kind":"drive#permission","pendingOwner":"\u003cboolean\u003e","permissionDetails":[{"inherited":"\u003cboolean\u003e","inheritedFrom":"\u003cstring\u003e","permissionType":"\u003cstring\u003e","role":"\u003cstring\u003e"},{"inherited":"\u003cboolean\u003e","inheritedFrom":"\u003cstring\u003e","permissionType":"\u003cstring\u003e","role":"\u003cstring\u003e"}],"photoLink":"\u003cstring\u003e","role":"\u003cstring\u003e","teamDrivePermissionDetails":[{"inherited":"\u003cboolean\u003e","inheritedFrom":"\u003cstring\u003e","role":"\u003cstring\u003e","teamDrivePermissionType":"\u003cstring\u003e"},{"inherited":"\u003cboolean\u003e","inheritedFrom":"\u003cstring\u003e","role":"\u003cstring\u003e","teamDrivePermissionType":"\u003cstring\u003e"}],"type":"\u003cstring\u003e","view":"\u003cstring\u003e"}