Google Drive
13 tools • OpenAPI spec ↗
GETlist_files/filesList files and folders in Google Drive. Optionally filter by parent folder ID. Returns file metadata including id, name, mimeType, and links.
Request
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| folderId | string | No | ID of the parent folder to list files from. When provided, only files in this folder are returned. |
| pageSize | number | No | Maximum number of files to return per page (1-1000, default 100). |
| pageToken | string | No | Token for paginating through results. |
| orderBy | string | No | Sort order (e.g. 'modifiedTime desc', 'name', 'folder,modifiedTime desc'). |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "list_files"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "list_files",
"params": {}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-drive/files Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"files": null,
"nextPageToken": null,
"incompleteSearch": null
}POSTsearch_files/files/searchSearch for files and folders in Google Drive. Uses the Drive query syntax for the 'q' parameter (e.g. "name contains 'report'" or "mimeType = 'application/vnd.google-apps.folder'"). Returns file metadata including id, name, mimeType, and links.
Request
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | No | Drive search query (e.g. "name contains 'report'", "mimeType = 'application/vnd.google-apps.folder'", "'folderId' in parents"). See Google Drive API query syntax. |
| pageSize | number | No | Maximum number of files to return per page (1-1000, default 100). |
| pageToken | string | No | Token for paginating through results. |
| orderBy | string | No | Sort order (e.g. 'modifiedTime desc', 'name', 'folder,modifiedTime desc'). |
| corpora | string | No | Source of files: 'user', 'drive', 'domain', or 'allDrives' (default 'allDrives'). |
| driveId | string | No | ID of the shared drive to search. Required when corpora is 'drive'. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "search_files"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "search_files",
"params": {}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-drive/files/search Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"files": null,
"nextPageToken": null,
"incompleteSearch": null
}GETget_file/files/:fileIdGet metadata for a single file or folder by its ID. Returns detailed file information including name, MIME type, size, timestamps, owners, and links.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file or folder to retrieve. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "get_file"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "get_file",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-drive/files/:fileId Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"id": null,
"name": null,
"mimeType": null,
"description": null,
"starred": null,
"trashed": null,
"parents": null,
"webViewLink": null,
"webContentLink": null,
"iconLink": null,
"thumbnailLink": null,
"size": null,
"createdTime": null,
"modifiedTime": null,
"owners": null,
"lastModifyingUser": null,
"shared": null,
"capabilities": null
}GETget_file_content/files/:fileId/contentGet the content of a file. For Google Docs, exports as plain text. For Google Sheets, exports as CSV. For other Google Workspace types, exports in a suitable text format. For binary files (PDFs, images, etc.), returns a download URL instead of inline content.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file to get content from. |
Response
Runtime output is unvalidated JSON (raw passthrough).
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "get_file_content"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "get_file_content",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-drive/files/:fileId/content Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"fileId": null,
"name": null,
"mimeType": null,
"content": null,
"exportedMimeType": null,
"downloadUrl": null
}GETexport_file/files/:fileId/exportExport a Google Workspace file (Docs, Sheets, Slides, Drawings) to a specified MIME type. For example, export a Google Doc as 'application/pdf' or 'text/html', or a Sheet as 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the Google Workspace file to export. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| mimeType | string | No | The MIME type to export to (e.g. 'application/pdf', 'text/html', 'text/csv', 'text/plain'). |
Response
Runtime output is unvalidated JSON (raw passthrough).
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "export_file"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "export_file",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-drive/files/:fileId/export Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"fileId": null,
"name": null,
"mimeType": null,
"content": null,
"exportedMimeType": null,
"downloadUrl": null
}POSTupload_file/filesUpload a file to Google Drive. The file content must be provided as a base64-encoded string.
Request
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | The name for the uploaded file. |
| content | string | No | The file content as a base64-encoded string. |
| mimeType | string | No | The MIME type of the file (e.g. 'application/pdf'). |
| folderId | string | No | ID of the parent folder to upload into. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "upload_file"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "upload_file",
"params": {}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-drive/files Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"id": null,
"name": null,
"mimeType": null,
"description": null,
"starred": null,
"trashed": null,
"parents": null,
"webViewLink": null,
"webContentLink": null,
"iconLink": null,
"thumbnailLink": null,
"size": null,
"createdTime": null,
"modifiedTime": null,
"owners": null,
"lastModifyingUser": null,
"shared": null,
"capabilities": null
}POSTcreate_folder/foldersCreate a new folder in Google Drive. Optionally specify a parent folder.
Request
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | The name for the new folder. |
| parentId | string | No | ID of the parent folder to create the folder in. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "create_folder"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "create_folder",
"params": {}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-drive/folders Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"id": null,
"name": null,
"mimeType": null,
"description": null,
"starred": null,
"trashed": null,
"parents": null,
"webViewLink": null,
"webContentLink": null,
"iconLink": null,
"thumbnailLink": null,
"size": null,
"createdTime": null,
"modifiedTime": null,
"owners": null,
"lastModifyingUser": null,
"shared": null,
"capabilities": null
}POSTmove_file/files/:fileId/moveMove a file or folder to a different parent folder in Google Drive. By default removes the file from its current parent.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file or folder to move. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| newParentId | string | No | The ID of the destination parent folder. |
| removeFromCurrentParent | boolean | No | Whether to remove the file from its current parent folder (default true). |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "move_file"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "move_file",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-drive/files/:fileId/move Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"id": null,
"name": null,
"mimeType": null,
"description": null,
"starred": null,
"trashed": null,
"parents": null,
"webViewLink": null,
"webContentLink": null,
"iconLink": null,
"thumbnailLink": null,
"size": null,
"createdTime": null,
"modifiedTime": null,
"owners": null,
"lastModifyingUser": null,
"shared": null,
"capabilities": null
}PATCHrename_file/files/:fileIdRename a file or folder in Google Drive.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file or folder to rename. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| newName | string | No | The new name for the file or folder. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "rename_file"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "rename_file",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
PATCH https://app.ferrule.io/api/v1/google-drive/files/:fileId Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"id": null,
"name": null,
"mimeType": null,
"description": null,
"starred": null,
"trashed": null,
"parents": null,
"webViewLink": null,
"webContentLink": null,
"iconLink": null,
"thumbnailLink": null,
"size": null,
"createdTime": null,
"modifiedTime": null,
"owners": null,
"lastModifyingUser": null,
"shared": null,
"capabilities": null
}DELETEtrash_file/files/:fileIdMove a file or folder to the trash in Google Drive. The file can be recovered from the trash within 30 days.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file or folder to trash. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "trash_file"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "trash_file",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
DELETE https://app.ferrule.io/api/v1/google-drive/files/:fileId Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"id": null,
"name": null,
"mimeType": null,
"description": null,
"starred": null,
"trashed": null,
"parents": null,
"webViewLink": null,
"webContentLink": null,
"iconLink": null,
"thumbnailLink": null,
"size": null,
"createdTime": null,
"modifiedTime": null,
"owners": null,
"lastModifyingUser": null,
"shared": null,
"capabilities": null
}GETlist_revisions/files/:fileId/revisionsList historical revisions of a file in Google Drive. Returns revision metadata including id, mimeType, modifiedTime, size, and (for Google-native types) exportLinks that can be used to fetch revision content.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file whose revisions should be listed. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pageSize | number | No | Maximum number of revisions to return per page (1-1000, default 200). |
| pageToken | string | No | Token for paginating through results. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "list_revisions"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "list_revisions",
"params": {
"fileId": "<fileId>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-drive/files/:fileId/revisions Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"revisions": null,
"nextPageToken": null,
"kind": null
}GETget_revision_content/files/:fileId/revisions/:revisionId/contentGet the content of a specific revision of a file. For Google Workspace types (Docs, Sheets, Slides, Drawings), exports the revision as text and inlines it if small enough; otherwise returns metadata with a downloadPath for REST retrieval. For binary files, returns metadata only and a downloadPath the caller can fetch via the REST API. When called via REST, the raw revision bytes are streamed as an HTTP attachment.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | The ID of the file whose revision should be fetched. |
| revisionId | string | Yes | The ID of the revision to fetch. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-drive",
"method": "get_revision_content"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-drive",
"arguments": {
"method": "get_revision_content",
"params": {
"fileId": "<fileId>",
"revisionId": "<revisionId>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-drive/files/:fileId/revisions/:revisionId/content Authorization: Bearer <your-api-key> Content-Type: application/json