drive.permissions.create
Creates a permission on a file or shared drive to grant users, groups, or domains access with a specified role. Use it to share Drive items via the API.
Instructions
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 [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON Permission object accepting allowFileDiscovery, deleted, displayName, domain, emailAddress, expirationTime, id, inheritedPermissionsDisabled and 8 more fields; pass it via params or whole via body_file Siblings over the same resource: delete, get, list, update.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Extra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe. | |
| fileId | Yes | [URL path segment] The ID of the file or shared drive. | |
| params | No | Parameter map merged into the request; typed parameters win. | |
| dry_run | No | Return the request that would be sent, without sending it. | |
| body_file | No | Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Permission object. | |
| emailMessage | No | [query parameter] A plain text custom message to include in the notification email. | |
| request_body | No | Request body of type Permission: pass it via `params` (merged into the built body) or whole via `body_file`. | |
| supportsAllDrives | No | [query parameter] Whether the requesting application supports both My Drives and shared drives. | false |
| transferOwnership | No | [query parameter] 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 ef | false |
| supportsTeamDrives | No | [query parameter] Deprecated: Use `supportsAllDrives` instead. | false |
| enforceSingleParent | No | [query parameter] Deprecated: See `moveToNewOwnersRoot` for details. | false |
| moveToNewOwnersRoot | No | [query parameter] 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 | false |
| useDomainAdminAccess | No | [query parameter] 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 | false |
| sendNotificationEmail | No | [query parameter] 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 mu | |
| enforceExpansiveAccess | No | [query parameter] Deprecated: All requests use the expansive access rules. | false |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| kind | No | ||
| role | No | ||
| type | No | ||
| view | No | ||
| domain | No | ||
| deleted | No | ||
| photoLink | No | ||
| displayName | No | ||
| emailAddress | No | ||
| pendingOwner | No | ||
| expirationTime | No | ||
| permissionDetails | No | ||
| allowFileDiscovery | No | ||
| teamDrivePermissionDetails | No | ||
| inheritedPermissionsDisabled | No |