Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Google Drive Permissions API
version: v3
description: Generated from Google's published Discovery document for Google Drive API (drive v3, revision 20261106). 5 operation(s).
contact:
name: Google
url: https://developers.google.com/
termsOfService: https://developers.google.com/terms
servers:
- url: https://www.googleapis.com
tags:
- name: Permissions
paths:
/drive/v3/files/{fileId}/permissions/{permissionId}:
get:
operationId: drive.permissions.get
summary: Get permissions
description: Gets a permission by ID. For more information, see Share files, folders, and drives.
parameters:
- name: fileId
in: path
required: true
description: The ID of the file.
schema:
type: string
- name: permissionId
in: path
required: true
description: The ID of the permission.
schema:
type: string
- name: supportsAllDrives
in: query
required: false
description: Whether the requesting application supports both My Drives and shared drives.
schema:
type: boolean
default: 'false'
- name: supportsTeamDrives
in: query
required: false
description: 'Deprecated: Use `supportsAllDrives` instead.'
schema:
type: boolean
default: 'false'
deprecated: true
- name: useDomainAdminAccess
in: query
required: false
description: '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](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).'
schema:
default: 'false'
type: boolean
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
4XX:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/drive.file
- https://www.googleapis.com/auth/drive.meet.readonly
- https://www.googleapis.com/auth/drive.metadata
- https://www.googleapis.com/auth/drive.metadata.readonly
- https://www.googleapis.com/auth/drive.photos.readonly
- https://www.googleapis.com/auth/drive.readonly
- apiKey: []
tags:
- Permissions
delete:
operationId: drive.permissions.delete
summary: Delete permissions
description: Deletes a permission. 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.
parameters:
- name: fileId
in: path
required: true
description: The ID of the file or shared drive.
schema:
type: string
- name: permissionId
in: path
required: true
description: The ID of the permission.
schema:
type: string
- name: enforceExpansiveAccess
in: query
required: false
description: 'Deprecated: All requests use the expansive access rules.'
schema:
default: 'false'
type: boolean
deprecated: true
- name: supportsAllDrives
in: query
required: false
description: Whether the requesting application supports both My Drives and shared drives.
schema:
default: 'false'
type: boolean
- name: supportsTeamDrives
in: query
required: false
description: 'Deprecated: Use `supportsAllDrives` instead.'
schema:
default: 'false'
type: boolean
deprecated: true
- name: useDomainAdminAccess
in: query
required: false
description: '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](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).'
schema:
type: boolean
default: 'false'
responses:
'200':
description: Successful response
4XX:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/drive.file
- apiKey: []
tags:
- Permissions
patch:
operationId: drive.permissions.update
summary: Update permissions
description: 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.
parameters:
- name: fileId
in: path
required: true
description: The ID of the file or shared drive.
schema:
type: string
- name: permissionId
in: path
required: true
description: The ID of the permission.
schema:
type: string
- name: enforceExpansiveAccess
in: query
required: false
description: 'Deprecated: All requests use the expansive access rules.'
schema:
default: 'false'
type: boolean
deprecated: true
- name: removeExpiration
in: query
required: false
description: Whether to remove the expiration date.
schema:
type: boolean
default: 'false'
- name: supportsAllDrives
in: query
required: false
description: Whether the requesting application supports both My Drives and shared drives.
schema:
type: boolean
default: 'false'
- name: supportsTeamDrives
in: query
required: false
description: 'Deprecated: Use `supportsAllDrives` instead.'
schema:
default: 'false'
type: boolean
deprecated: true
- name: transferOwnership
in: query
required: false
description: 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](https://developers.google.com//workspace/drive/api/guides/transfer-file).
schema:
type: boolean
default: 'false'
- name: useDomainAdminAccess
in: query
required: false
description: '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](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).'
schema:
type: boolean
default: 'false'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
4XX:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/drive.file
- apiKey: []
tags:
- Permissions
/drive/v3/files/{fileId}/permissions:
get:
operationId: drive.permissions.list
summary: List permissions
description: Lists a file's or shared drive's permissions. For more information, see Share files, folders, and drives.
parameters:
- name: fileId
in: path
required: true
description: The ID of the file or shared drive.
schema:
type: string
- name: includePermissionsForView
in: query
required: false
description: Specifies which additional view's permissions to include in the response. Only `published` is supported.
schema:
type: string
- name: pageSize
in: query
required: false
description: The maximum number of permissions to return. The service may return fewer than this value. If unspecified, at most 100 permissions will be returned for shared drives, and the entire list of permissions for non-shared drives. The maximum value is 100; values above 100 will be coerced to 100.
schema:
format: int32
type: integer
maximum: 100
minimum: 1
- name: pageToken
in: query
required: false
description: The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from the previous response.
schema:
type: string
- name: supportsAllDrives
in: query
required: false
description: Whether the requesting application supports both My Drives and shared drives.
schema:
default: 'false'
type: boolean
- name: supportsTeamDrives
in: query
required: false
description: 'Deprecated: Use `supportsAllDrives` instead.'
schema:
type: boolean
default: 'false'
deprecated: true
- name: useDomainAdminAccess
in: query
required: false
description: '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](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).'
schema:
type: boolean
default: 'false'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PermissionList'
4XX:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/drive.file
- https://www.googleapis.com/auth/drive.meet.readonly
- https://www.googleapis.com/auth/drive.metadata
- https://www.googleapis.com/auth/drive.metadata.readonly
- https://www.googleapis.com/auth/drive.photos.readonly
- https://www.googleapis.com/auth/drive.readonly
- apiKey: []
tags:
- Permissions
post:
operationId: drive.permissions.create
summary: Create permissions
description: Creates a permission for a file or shared drive. 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.
parameters:
- name: fileId
in: path
required: true
description: The ID of the file or shared drive.
schema:
type: string
- name: emailMessage
in: query
required: false
description: A plain text custom message to include in the notification email.
schema:
type: string
- name: enforceExpansiveAccess
in: query
required: false
description: 'Deprecated: All requests use the expansive access rules.'
schema:
type: boolean
default: 'false'
deprecated: true
- name: enforceSingleParent
in: query
required: false
description: 'Deprecated: See `moveToNewOwnersRoot` for details.'
schema:
default: 'false'
type: boolean
deprecated: true
- name: moveToNewOwnersRoot
in: query
required: false
description: This parameter only takes effect if the item isn't in a shared drive and the request is attempting to transfer the ownership of the item. If set to `true`, the item is moved to the new owner's My Drive root folder and all prior parents removed. If set to `false`, parents aren't changed.
schema:
type: boolean
default: 'false'
- name: sendNotificationEmail
in: query
required: false
description: Whether to send a notification email when sharing to users or groups. This defaults to `true` for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.
schema:
type: boolean
- name: supportsAllDrives
in: query
required: false
description: Whether the requesting application supports both My Drives and shared drives.
schema:
type: boolean
default: 'false'
- name: supportsTeamDrives
in: query
required: false
description: 'Deprecated: Use `supportsAllDrives` instead.'
schema:
default: 'false'
type: boolean
deprecated: true
- name: transferOwnership
in: query
required: false
description: 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](https://developers.google.com/workspace/drive/api/guides/transfer-file).
schema:
type: boolean
default: 'false'
- name: useDomainAdminAccess
in: query
required: false
description: '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](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).'
schema:
type: boolean
default: 'false'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Permission'
4XX:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/drive.file
- apiKey: []
tags:
- Permissions
components:
schemas:
GoogleRpcError:
type: object
description: The error envelope every Google API returns.
properties:
error:
type: object
properties:
code:
type: integer
message:
type: string
status:
type: string
details:
type: array
items:
type: object
PermissionList:
properties:
kind:
type: string
default: drive#permissionList
description: 'Identifies what kind of resource this is. Value: the fixed string `"drive#permissionList"`.'
nextPageToken:
type: string
description: The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
permissions:
items:
$ref: '#/components/schemas/Permission'
type: array
description: The list of permissions. If `nextPageToken` is populated, then this list may be incomplete and an additional page of results should be fetched.
description: A list of permissions for a file.
type: object
Permission:
description: A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
properties:
teamDrivePermissionDetails:
readOnly: true
type: array
description: 'Output only. Deprecated: Output only. Use `permissionDetails` instead.'
items:
type: object
properties:
role:
type: string
description: 'Deprecated: Output only. Use `permissionDetails/role` instead.'
deprecated: true
inheritedFrom:
type: string
description: 'Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.'
deprecated: true
inherited:
type: boolean
description: 'Deprecated: Output only. Use `permissionDetails/inherited` instead.'
deprecated: true
teamDrivePermissionType:
type: string
description: 'Deprecated: Output only. Use `permissionDetails/permissionType` instead.'
deprecated: true
deprecated: true
photoLink:
description: Output only. A link to the user's profile photo, if available.
type: string
type:
description: '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.'
type: string
kind:
default: drive#permission
type: string
description: 'Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#permission"`.'
inheritedPermissionsDisabled:
type: boolean
description: When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
domain:
type: string
description: Output only. The domain to which this permission refers.
readOnly: true
deleted:
type: boolean
description: Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
emailAddress:
readOnly: true
description: Output only. The email address of the user or group to which this permission refers.
type: string
permissionDetails:
type: array
description: Output only. Details of whether the permissions on this item are inherited or are directly on this item.
readOnly: true
items:
type: object
properties:
inheritedFrom:
readOnly: true
description: Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
type: string
role:
type: string
description: 'Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).'
inherited:
description: Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
type: boolean
permissionType:
type: string
description: 'Output only. The permission type for this user. Supported values include: * `file` * `member`'
view:
description: '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](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).'
type: string
id:
type: string
description: Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
pendingOwner:
type: boolean
description: 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.
allowFileDiscovery:
description: Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
type: boolean
role:
description: 'The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).'
type: string
displayName:
type: string
description: '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.'
expirationTime:
description: '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'
format: date-time
type: string
type: object
securitySchemes:
apiKey:
type: apiKey
in: query
name: key
description: API key; accepted by methods that do not need user data.
oauth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://accounts.google.com/o/oauth2/auth
tokenUrl: https://oauth2.googleapis.com/token
scopes:
https://www.googleapis.com/auth/drive.appdata: See, create, and delete its own configuration data in your Google Drive
https://www.googleapis.com/auth/drive.readonly: See and download all your Google Drive files
https://www.googleapis.com/auth/drive.photos.readonly: View the photos, videos and albums in your Google Photos
https://www.googleapis.com/auth/drive.file: See, edit, create, and delete only the specific Google Drive files you use with this app
https://www.googleapis.com/auth/drive.metadata.readonly: See information about your Google Drive files
https://www.googleapis.com/auth/drive.meet.readonly: See and download your Google Drive files that were created or edited by Google Meet.
https://www.googleapis.com/auth/drive: See, edit, create, and delete all of your Google Drive files
https://www.googleapis.com/auth/drive.apps.readonly: View your Google Drive apps
https://www.googleapis.com/auth/drive.metadata: View and manage metadata of files in your Google Drive
https://www.googleapis.com/auth/drive.scripts: Modify your Google Apps Script scripts' behavior
externalDocs:
url: https://developers.google.com/workspace/drive/
x-provenance:
method: harvested
publisher: Google
source: https://www.googleapis.com/discovery/v1/apis/drive/v3/rest
note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261106)