> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive

> Connect Google Drive to xpander and give agents its 58 actions: how to sign in and connect it, and which actions to hold for approval.

<Badge color="blue">HTTP API connector</Badge>

An HTTP API described by an OpenAPI spec, not an MCP server. Calls go to `https://www.googleapis.com/drive/v3` and carry an OAuth 2.0 token obtained with **Sign in with Google** on the cloud edition, or an API key or custom header on a self-hosted installation, which offers no sign-in flow.

## What the skill can do

API connector: 58 actions, as they appear in the skill panel. 32 of them create, change or delete something in Google Drive; mark those under **These actions need approval** when you add the skill to an agent.

* **Drive management** (16): Unhide Shared Drive, List User Shared Drives, Create Shared Drive, Get Shared Drive Metadata, Hide Shared Drive, Delete Shared Drive, Update Shared Drive Metadata, Cancel Long-Running Operation, Get Operation State, List Team Drives (Deprecated), Delete Team Drive (Deprecated), List Operations by Filter, Create Team Drive (Deprecated), Get Team Drive (Deprecated), and 2 more
* **File management** (13): Get User Drive Info, List User Files, Create File with Upload, Permanently Delete Trashed Files, Update File Metadata/Content, Copy File with Updates, Generate File IDs, Permanently Delete File, Download File Content, List File Labels, Export Document by MIME Type, Modify File Labels, Subscribe to File Changes
* **Comment service** (10): List File Comments, Get Comment by ID, Delete Comment, List Comment Replies, Create Reply to Comment, Update Reply with Patch, Create File Comment, Update Comment with Patch, Delete Reply by ID, Get Reply by ID
* **Change tracking** (5): Subscribe to User Changes, Get Start Page Token, List User Changes, Stop Watching Resources, Get File Metadata or Content
* **Permission service** (5): List File Permissions, Get Permission by ID, Delete Permission, Create File Permission, Update Permission with Patch
* **Revision service** (4): Delete File Version, Update Revision with Patch, Get Revision Metadata by ID, List File Revisions
* **Access proposal service** (3): List File Proposals, Get Access Proposal by ID, Resolve Proposal Action
* **App management** (2): Get App Details, List Installed Apps

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/pzRhrv6nqUySeaGz/images/connectors/google-drive.png?fit=max&auto=format&n=pzRhrv6nqUySeaGz&q=85&s=8c219fbb36731b9f5e4723d726b8af08" alt="" width="919" height="516" data-path="images/connectors/google-drive.png" />
</Frame>

## Authentication Options

<Tabs>
  <Tab title="Built-in xpander Auth">
    The simplest way to connect Google Drive is using xpander's built-in authentication:

    1. In Xpander Chat, open the agent's settings and click **Add skill**.
    2. Search for **Google Drive** and select it.
    3. Click **Sign in with Google**
    4. Select your Google account and grant permissions
    5. Your connection is immediately active and ready to use

    <Note>
      This method is recommended for most users. xpander securely manages your OAuth tokens without exposing any credentials.
    </Note>
  </Tab>

  <Tab title="API Access">
    For programmatic access and automation:

    1. Go to [Google Cloud Console](https://console.cloud.google.com/)
    2. Create a new project or select an existing one
    3. Enable the **Google Drive API** in Library
    4. Go to **Credentials** and create an **API Key**
    5. Restrict the API key to Google Drive API only
    6. Copy the API key to xpander's Google Drive connection settings
    7. Set appropriate API access restrictions in Google Cloud Console

    <Warning>
      API keys provide limited functionality and are best for read-only operations on public files. For full access, use OAuth methods.
    </Warning>
  </Tab>

  <Tab title="Manual OAuth Configuration">
    For advanced customization and enterprise setups:

    ### Step 1: Create OAuth Credentials

    1. Log into [Google Cloud Console](https://console.cloud.google.com/)
    2. Create a new project or select existing one
    3. Enable the **Google Drive API** in Library
    4. Configure **OAuth consent screen** with appropriate scopes:
       * `/auth/drive.file` (recommended)
       * `/auth/drive` (full access)
       * `/auth/drive.readonly` (read-only)
    5. Create **OAuth 2.0 credentials** (Client ID & Secret)
    6. Add the redirect URI that xpander shows in the connect dialog (on xpander's cloud it is under `api.xpander.ai`)

    ### Step 2: Connect Google Drive in xpander

    1. In Xpander Chat, open the agent's settings and click **Add skill**.
    2. Search for **Google Drive** and select it.
    3. Choose **Manual Configuration**.
    4. Enter your **Client ID** and **Client Secret**
    5. Specify the required scopes
    6. Click **Authorize** and complete the OAuth flow
    7. Verify connection is active

    <Tip>
      Manual configuration gives you precise control over permissions and is recommended for enterprise deployments or specific security requirements.
    </Tip>
  </Tab>

  <Tab title="Service Accounts">
    For organization-wide access or automated workflows without user intervention:

    ### Step 1: Create a Service Account

    1. Log into [Google Cloud Console](https://console.cloud.google.com/)
    2. Navigate to your project → **IAM & Admin** → **Service Accounts**
    3. Click **Create Service Account**
    4. Give it a name and description
    5. Assign appropriate roles (e.g., "Drive File Creator")
    6. Create and download a JSON key file

    ### Step 2: Connect Google Drive in xpander

    1. In Xpander Chat, open the agent's settings and click **Add skill**.
    2. Search for **Google Drive** and select it.
    3. Choose **Service Account**.
    4. Upload the JSON key file
    5. Verify the connection status

    ### Step 3: Share Resources

    * Share specific Google Drive folders/files with the service account's email address
    * The email usually follows this format: `service-account-name@project-id.iam.gserviceaccount.com`

    <Note>
      Service accounts act as separate Google identities and are ideal for background processes, automation, and accessing shared organizational resources without user intervention.
    </Note>
  </Tab>
</Tabs>

## Google Drive AI Integration Troubleshooting

### Common Authentication Issues

* Verify Client ID and Secret are entered correctly in xpander
* Ensure the complete OAuth flow was successfully completed
* Check that redirect URIs match exactly between Google Cloud and xpander
* Confirm Google Drive API is enabled in Google Cloud Console for your project

## Related Resources

* [Skills](/use/skills)
* [Google Drive API Documentation](https://developers.google.com/drive/api/v3/about-sdk)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.