File Operations
Upload, organize, and share Google Drive files — create folders, rename, move, trash, and manage sharing permissions.
/api/access/drive/files/uploadBearer TokenUpload File
Upload a new file to Google Drive. Send the raw file content as the request body; metadata is passed via query parameters.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
| fileName | Yes | Name for the uploaded file |
| mimeType | No | MIME type (auto-detected if omitted) |
| folderId | No | Target folder ID (provider-prefixed) |
| description | No | File description |
Max File Size
upload_file permission.Response 200 OK
{ "success": true, "fileId": "google:1NEW_FILE_ID..." } Response 403 Forbidden
{ "success": false, "errorMessage": "Token does not allow uploading files.", "errorCode": "OPERATION_NOT_ALLOWED" } /api/access/drive/foldersBearer TokenCreate Folder
Create a new folder in Google Drive.
Request Body (JSON)
| Field | Required | Description |
|---|---|---|
| name | Yes | Folder name |
| parentFolderId | No | Parent folder ID (provider-prefixed). Omit for root. |
| description | No | Folder description |
Required Operation
create_folder permission.{ "name": "New Project Folder", "parentFolderId": "google:0B7_abc...", "description": "Contains project deliverables" } /api/access/drive/files/{fileId}/renameBearer TokenRename File
Rename a file or folder in Google Drive.
Required Operation
rename_file permission.{ "newName": "Updated Report v2.pdf" } Response 404 Not Found
{ "error": "File not found" } /api/access/drive/files/{fileId}/moveBearer TokenMove File
Move a file to a different folder in Google Drive.
Required Operation
move_file permission.{ "destinationFolderId": "google:0B7_DEST_FOLDER..." } /api/access/drive/files/{fileId}Bearer TokenDelete File (Trash)
Moves the file to Google Drive trash. This is not a permanent deletion — the file can be restored from trash.
Required Operation
delete_file permission.Not Permanent
Success response: 204 No Content (empty body)
Response 404 Not Found
{ "error": "File not found or could not be deleted" } Request Body (JSON)
| Field | Required | Description |
|---|---|---|
| type | Yes | user, group, domain, or anyone |
| role | Yes | reader, writer, or commenter |
| emailAddress | For user/group | Email address to share with |
| domain | For domain | Domain to share with (e.g., example.com) |
| sendNotification | No | Send email notification (default: true) |
| message | No | Custom notification message |
Required Operation
share_file permission.{ "type": "user", "role": "reader", "emailAddress": "colleague@example.com", "sendNotification": true, "message": "Here's the project brief" } Response 403 Forbidden
{ "success": false, "errorMessage": "Access to this file is restricted.", "errorCode": "ACCESS_RESTRICTED" }