Skip to content

File Operations

Upload, organize, and share Google Drive files — create folders, rename, move, trash, and manage sharing permissions.

POST/api/access/drive/files/uploadBearer Token

Upload 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

ParameterRequiredDescription
fileNameYesName for the uploaded file
mimeTypeNoMIME type (auto-detected if omitted)
folderIdNoTarget folder ID (provider-prefixed)
descriptionNoFile description

Max File Size

Maximum upload size is 100 MB. Requires 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"
}
POST/api/access/drive/foldersBearer Token

Create Folder

Create a new folder in Google Drive.

Request Body (JSON)

FieldRequiredDescription
nameYesFolder name
parentFolderIdNoParent folder ID (provider-prefixed). Omit for root.
descriptionNoFolder description

Required Operation

Requires create_folder permission.
{
"name": "New Project Folder",
"parentFolderId": "google:0B7_abc...",
"description": "Contains project deliverables"
}
PATCH/api/access/drive/files/{fileId}/renameBearer Token

Rename File

Rename a file or folder in Google Drive.

Required Operation

Requires rename_file permission.
{
"newName": "Updated Report v2.pdf"
}

Response 404 Not Found

{
"error": "File not found"
}
PATCH/api/access/drive/files/{fileId}/moveBearer Token

Move File

Move a file to a different folder in Google Drive.

Required Operation

Requires move_file permission.
{
"destinationFolderId": "google:0B7_DEST_FOLDER..."
}
DELETE/api/access/drive/files/{fileId}Bearer Token

Delete File (Trash)

Moves the file to Google Drive trash. This is not a permanent deletion — the file can be restored from trash.

Required Operation

Requires delete_file permission.

Not Permanent

This endpoint moves the file to trash. The file can be restored from the Google Drive trash by the file owner.

Success response: 204 No Content (empty body)

Response 404 Not Found

{
"error": "File not found or could not be deleted"
}
POST/api/access/drive/files/{fileId}/shareBearer Token

Share File

Share a file with a user, group, domain, or make it public.

Request Body (JSON)

FieldRequiredDescription
typeYesuser, group, domain, or anyone
roleYesreader, writer, or commenter
emailAddressFor user/groupEmail address to share with
domainFor domainDomain to share with (e.g., example.com)
sendNotificationNoSend email notification (default: true)
messageNoCustom notification message

Required Operation

Requires 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"
}