Skip to main content
POST
Share a Google Drive file with a person or the organization

Path Parameters

fileId
string
required

Google Drive file id.

Required string length: 1 - 512

Body

application/json
type
enum<string>
required

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

Available options:
user,
domain
emailAddress
string<email>

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

Maximum string length: 320
Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
domain
string

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

Required string length: 1 - 255
role
enum<string>
default:reader

Drive permission role to grant.

Available options:
reader,
commenter,
writer
sendNotificationEmail
boolean
default:true

Whether Google should email the recipient about the new access.

Response

Google Drive file shared.

ok
boolean
required
fileId
string
required
permissionId
string
required
type
string
required
role
string
required