View as Markdown
Google Drive icon

Google Drive ACTION

Share File

Share a file or folder in Google Drive by creating a sharing permission. Supports sharing with a specific user, a group, an entire domain, or anyone with the link. Use Search Files first to find the file ID by name.

Sharing types:

  • user — share with a specific person (requires emailAddress)
  • group — share with a Google Group (requires emailAddress)
  • domain — share with everyone in a Google Workspace domain (requires domain)
  • anyone — share with anyone who has the link (no email/domain needed)

Roles: reader (view only), commenter (can comment), writer (can edit). Use List Permissions to see existing sharing on a file. See the documentation

  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Google Drive account once, then configure and run Share File from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_drive-share-file",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_drive: { authProvisionId: "apn_xxxxxxx" },
    fileId: "File ID",
    type: "Type",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Share File inputs
Property Type Description
fileId File ID string
The ID of the file or folder to share. Use Search Files to find the file ID by name.
Required
type Type string
The type of grantee: user, group, domain, or anyone.
Required
role Role string
The access level to grant: reader (view), commenter (comment), or writer (edit).
Required
emailAddress Email Address string
The email address of the user or group to share with. Required when type is user or group. Ignored for domain and anyone.
Optional
domain Domain string
The Google Workspace domain to share with (e.g., example.com). Required when type is domain. Ignored for other types.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
google_drive-share-file
Version
0.0.4
App
Google Drive
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes