SharePoint File Operations
Upload, create, rename, move, recycle, and share SharePoint files. Each operation requires its own flag in allowedSharePointOperations. Connections with read-only scopes return READONLY_SCOPE on every write.
/api/access/sharepoint/files/uploadBearer TokenUpload File
Uploads a new file. Binary travels in the raw request body, metadata in the query string.
Required Operation
upload_file. Server enforces a 100 MB body ceiling.POST /api/access/sharepoint/files/upload ?fileName=Plan.docx &folderId=sharepoint:drive:b!…:item:01ROOT &mimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document &description=Q2%20draft Content-Type: <fileMimeType> <binary body> Query Parameters
| Parameter | Required | Notes |
|---|---|---|
| fileName | yes | Name to assign in SharePoint |
| folderId | yes | Target folder/library — prefixed file ID |
| mimeType | no | If omitted, server falls back to Graph's auto-detect |
| description | no | Optional description metadata |
Response 200 OK
{ "success": true, "fileId": "sharepoint:drive:b!…:item:01NEW" } Response 403 Forbidden
{ "success": false, "errorMessage": "Connection has read-only scopes; cannot upload.", "errorCode": "READ_ONLY" } Possible errorCode values: READ_ONLY, OPERATION_NOT_ALLOWED, NO_PROVIDER, BLOCKED. READ_ONLY fires when the connection is delegated Files.Read.All-only or a Sites.Selected grant with role: read.
/api/access/sharepoint/foldersBearer TokenCreate Folder
Creates a folder under a library or another folder.
Required Operation
create_folder. Body shape: CreateDriveFolderRequest.{ "name": "Sprint 42", "parentFolderId": "sharepoint:drive:b!…:item:01ROOT", "description": "Optional" } /api/access/sharepoint/files/{fileId}/renameBearer TokenRename File
Renames a file or folder.
Required Operation
rename_file. Body shape: RenameDriveFileRequest.{ "newName": "Plan v2.docx" } /api/access/sharepoint/files/{fileId}/moveBearer TokenMove File
Moves a file/folder to a new parent within the same drive/document library.
Required Operation
move_file. Body shape: MoveDriveFileRequest.Same drive only
errorCode = "INVALID_ID". Source and destination must live in the same document library.{ "destinationFolderId": "sharepoint:drive:b!…:item:01DEST" } /api/access/sharepoint/files/{fileId}Bearer TokenDelete File
Soft-deletes a file/folder. The item lands in the SharePoint recycle bin.
Required Operation
delete_file.Soft delete
Response 204 No Content
(empty body) Required Operation
share_file. Body shape: ShareDriveFileRequest.{ "type": "user", "role": "reader", "emailAddress": "colleague@contoso.com", "sendNotification": true, "message": "Take a look" } Body Fields
| Field | Required | Allowed values |
|---|---|---|
| type | yes | user, group, domain, anyone |
| role | yes | reader, writer (commenter is mapped to reader for SharePoint) |
| emailAddress | for user, group | recipient identity |
| domain | for domain | tenant or external domain |
| sendNotification | no | default true |
| message | no | included in the email Microsoft sends |