Capability Sources

Share a Google Drive file with a person or the organization

Changed on

Creates a Drive permission for one file using the calling member's Google Workspace account. To share with one person pass type=user plus emailAddress; to share with the entire organization pass type=domain plus the org's Google Workspace domain (e.g. openworklabs.com). Sharing files not created through OpenWork needs the Full Drive access feature enabled by an admin.

post/v1/capabilities/google-workspace/drive-file-share/{fileId}

Request

  • Base URL: https://api.openworklabs.com
  • URL: https://api.openworklabs.com/v1/capabilities/google-workspace/drive-file-share/{fileId}
  • Auth: one of:
    • API key in header x-api-key
    • HTTP bearer

Path parameters

fileIdstring required

Google Drive file id.

Request body

type'user' | 'domain' required

Use type=user to share with one person, or type=domain to share with the entire organization.

emailAddressstring email

Required when type=user; pass the person's email address, for example raghav@openworklabs.com.

domainstring

Required when type=domain; pass the organization's Google Workspace domain, for example openworklabs.com.

role'reader' | 'commenter' | 'writer'

Drive permission role to grant.

sendNotificationEmailboolean

Whether Google should email the recipient about the new access.

Response

Google Drive file shared.

oktrue required
fileIdstring required
permissionIdstring required
typestring required
rolestring required

Changes

    • info

      added the optional property to the response with the status

    • info

      the endpoint scheme security bearerAuth was added to the API

    • info

      the endpoint scheme security denApiKey was added to the API