Permissions: create

Requires authorization

Creates a permission for a file or Team Drive. Try it now.

Request

HTTP request

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

Parameters

Parameter name Value Description
Path parameters
fileId string The ID of the file or Team Drive.
Optional query parameters
emailMessage string A custom message to include in the notification email.
sendNotificationEmail boolean 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.
supportsTeamDrives boolean Whether the requesting application supports Team Drives. (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. (Default: false)

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

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

Request body

In the request body, supply a Permissions resource with the following properties:

Property name Value Description Notes
Required Properties
role string The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
  • organizer
  • owner
  • writer
  • commenter
  • reader
writable
type string The type of the grantee. Valid values are:
  • user
  • group
  • domain
  • anyone
writable
Optional Properties
allowFileDiscovery boolean Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. writable
domain string The domain to which this permission refers. writable
emailAddress string The email address of the user or group to which this permission refers. 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.

Send feedback about...

Drive REST API
Drive REST API