App Logo
drive.google.com

Share a Google Drive file

Grant, update, or revoke a specific email's access to a Drive file (with a viewer/commenter/editor role), or toggle the file's general link-sharing mode between restricted and anyone-with-the-link.

Input

fileId required

Drive file id, i.e. the <id> in drive.google.com/file/d/<id>/view.

role optional

Access level to grant/update when email is given. Ignored when revoke is true.

email optional

Email to grant, update, or revoke access for. Combine with role to grant/update; combine with revoke:true to remove access.

notify optional

Whether to email the person when granting access. Defaults to Drive's own default (checked/true). Ignored for revoke/linkSharing.

revoke optional

When true (with email), removes that person's access instead of granting/updating it.

linkSharing optional

Sets the file's general link-sharing mode. Provide this instead of email/role/revoke.

Output

action required
fileId required
confirmed required

True if the site's own response confirmed the change (a permission id for grant, 204/200 for revoke, the new access level for link sharing). Also true on a no-op linkSharing call, where alreadySet reports the mode was already in force so no request was needed.

role optional
email optional
alreadySet optional

linkSharing only, and always present there: true when the requested mode was already the file's current one, so nothing changed and Drive issued no request; false when this call actually changed it. Absent for grant and revoke.

linkSharing optional

Start building not clicking