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

# Google Drive integration

[Back to list of integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)

Use the Google Drive integration to create, find, read, upload, move, and delete files and folders, export documents as PDFs, and manage sharing permissions through Action Tools. It also provides triggers for new files and folders.

| Authentication | Actions | Triggers |
| - | - | - |
| OAuth 2.0 | ([16](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems/google-drive#supported-actions)) | ([2](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems/google-drive#triggers)) |

## Supported actions

| Action | Use it to |
| - | - |
| [Create new folder](#create-new-folder) | Create a folder in Google Drive. |
| [Create new file](#create-new-file) | Create a text file from text. |
| [Read File Content](#read-file-content) | Read the contents of a file. |
| [Get File Information](#get-file-information) | Retrieve file or folder information by ID. |
| [List files](#list-files) | List files in a Drive folder. |
| [Search](#search) | Search a Drive folder for files or subfolders. |
| [Duplicate File](#duplicate-file) | Copy a file and return the new file ID. |
| [Save Document as PDF](#save-document-as-pdf) | Save a Google document as a PDF in Drive. |
| [Update permissions](#update-permissions) | Add or update a user's permission on a file or folder. |
| [Delete permissions](#delete-permissions) | Remove a user's permission from a file or folder. |
| [Set public access](#set-public-access) | Set public access for a file or folder. |
| [Move File](#move-file) | Move a file to another folder. |
| [Delete file](#delete-file) | Permanently delete a file from Drive. |
| [Trash file](#trash-file) | Move a file to the trash. |
| [Custom API Call](#custom-api-call) | Call a Google Drive API endpoint. |
| [Upload File](#upload-file) | Upload a file to Drive. |

## Triggers

| Trigger | Fires when |
| - | - |
| New File | A file is uploaded. Optionally select a parent folder, include Team Drives, and include file content in the trigger output. Including file content takes longer and may cause issues with large files. |
| New Folder | A folder is created or uploaded. Optionally select a parent folder and include Team Drives. |

## Prerequisites

* A Google account with access to the Drive files and folders used by your tools.
* Permission to authorize the Google Drive OAuth access requested in Studio. The connector requests the Google Drive scope `https://www.googleapis.com/auth/drive`.

## Set up the integration

**1. Connect Google Drive**

In **Integrations**, select **Google Drive** > **Connect**. On **Project Auth Profiles**, select **New Profile** > **Integration Profile** > **Google Drive** > **Continue**. Complete the OAuth 2.0 profile setup and authorize the Google account that has access to the files and folders your tools will use.

**2. Create the action tool**

In **Tools**, select **New Tool** > **Action** > **Google Drive** > **Continue**. Select the **Action** and **Auth Profile**, configure the inputs, and select **Create Tool**. Then [assign the tool to an agent](https://koreai.mintlify.site/agent-platform/tools/actions.md#assign-an-action-to-an-agent).

## Action reference

The fields below are the required inputs listed for each action in the connector catalog. Studio may also show optional settings for the selected action; configure those in the tool builder as needed.

> [accordion] Create new folder
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `folderName` | string | Name of the folder to create. |

> [accordion] Create new file
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileName` | string | Name of the file to create. |
> | `text` | string | Text content for the file. |
> | `fileType` | string | File type for the new file. |

> [accordion] Read File Content
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file to read. |

> [accordion] Get File Information
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `id` | string | ID of the file or folder to retrieve. |

> [accordion] List files
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `folderId` | string | ID of the folder to list. |

> [accordion] Search
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `queryTerm` | string | Search term or field to search. |
> | `operator` | string | Search operator. |
> | `query` | string | Search expression or value. |

> [accordion] Duplicate File
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file to duplicate. |
> | `name` | string | Name for the duplicate. |
> | `folderId` | string | ID of the destination folder. |

> [accordion] Save Document as PDF
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `documentId` | string | ID of the Google document to export. |
> | `folderId` | string | ID of the destination folder. |
> | `name` | string | Name for the PDF file. |

> [accordion] Update permissions
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file or folder. |
> | `user_email` | string | Email address of the user whose access to update. |
> | `permission_name` | string | Permission role to apply. |
> | `send_invitation_email` | boolean | Whether to send an invitation email. |

> [accordion] Delete permissions
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file or folder. |
> | `user_email` | string | Email address of the user whose access to remove. |
> | `permission_name` | string | Permission role to remove. |

> [accordion] Set public access
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file or folder to make publicly accessible. |

> [accordion] Move File
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file to move. |

> [accordion] Delete file
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file to permanently delete. |

> [accordion] Trash file
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileId` | string | ID of the file to move to the trash. |

> [accordion] Custom API Call
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `url` | string | Google Drive API endpoint URL. |
> | `method` | string | HTTP method for the request. |
> | `headers` | object | Request headers. |
> | `queryParams` | object | Query string parameters. |

> [accordion] Upload File
>
> | Required parameter | Type | Description |
> | - | - | - |
> | `fileName` | string | Name for the uploaded file. |
> | `file` | string | File URL or content to upload. |

## Trigger reference

> [accordion] New File
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | `parentFolder` | dropdown | No | Limit the trigger to a selected parent folder. |
> | `include_team_drives` | boolean | No | Include Team Drive folders when selecting the parent folder. Defaults to `false`. |
> | `include_file_content` | boolean | No | Include the file content in the trigger output. Defaults to `false`; fetching content can take longer and may cause issues with large files. |

> [accordion] New Folder
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | `parentFolder` | dropdown | No | Limit the trigger to a selected parent folder. |
> | `include_team_drives` | boolean | No | Include Team Drive folders when selecting the parent folder. Defaults to `false`. |

## Troubleshoot common issues

| Issue | Resolution |
| - | - |
| OAuth authorization fails | Confirm that you authorized the Google account with access to the required Drive items and approved the requested Drive permissions. |
| An action can't find a file or folder | Verify the ID and confirm the authorized account can access that item. |
| Permission changes fail | Confirm that the account can manage sharing for the specified file or folder. |
| A file isn't returned by a trigger | Check the selected parent folder and whether Team Drive folders are included. |
| File content is missing from the New File trigger | Enable **Include File Content**. Large files may take longer to fetch. |

## Related articles

* [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles)
* [Action Tools](https://koreai.mintlify.site/agent-platform/tools/actions.md)
* [Google Drive API](https://developers.google.com/workspace/drive/api/guides/about-sdk)


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