Use OneDrive to upload, download, search, and organize files and folders. The actions below also cover metadata, copying or moving items, sharing links, and deletion.
Sim requests these scopes when someone connects an OneDrive account. For a self-hosted deployment, register your own app with the provider using the settings below. See Integrations and OAuth for setup.
Setting Value Redirect URI <NEXT_PUBLIC_APP_URL>/api/auth/oauth2/callback/onedriveEnvironment variables MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET
Scope Description openidStandard authentication profileAccess profile information emailAccess email address Files.ReadRead OneDrive files Files.ReadWriteRead and write OneDrive files offline_accessAccess account when not using the application
Create text and Excel files, upload files, download files, list and search files, move or rename files, copy files, create sharing links, and delete files or folders.
Upload a file to OneDrive
Inputs and outputsParameter Type Required Description fileNamestring Yes The name of the file to upload (e.g., "report.pdf", "data.xlsx") filefile No The file to upload (binary) contentstring No The text content to upload (if no file is provided) mimeTypestring No The MIME type of the file to create (e.g., text/plain for .txt, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for .xlsx) folderIdstring No Folder ID to upload the file to (e.g., "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36M")
Parameter Type Description successboolean Whether the file was uploaded successfully fileobject The uploaded file object with metadata including id, name, webViewLink, webContentLink, and timestamps
Create a new folder in OneDrive
Inputs and outputsParameter Type Required Description folderNamestring Yes Name of the folder to create (e.g., "My Documents", "Project Files") folderIdstring No Parent folder ID to create the folder in (e.g., "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36M")
Parameter Type Description successboolean Whether the folder was created successfully fileobject The created folder object with metadata including id, name, webViewLink, and timestamps
Download a file from OneDrive
Inputs and outputsParameter Type Required Description fileIdstring Yes The ID of the file to download (e.g., "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36M") fileNamestring No Optional filename override (e.g., "report.pdf", "data.xlsx")
Parameter Type Description filefile Downloaded file stored in execution files
List files and folders in OneDrive
Inputs and outputsParameter Type Required Description folderIdstring No Folder ID to list files from (e.g., "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36M") querystring No Filter files by name prefix (e.g., "report", "invoice_2024") pageSizenumber No Maximum number of files to return (e.g., 10, 50, 100) pageTokenstring No Continuation URL from a previous response's nextPageToken, used to fetch the next page
Parameter Type Description successboolean Whether files were listed successfully filesarray Array of file and folder objects with metadata nextPageTokenstring Token for retrieving the next page of results (optional)
Search for files and folders across OneDrive by name, metadata, or content (recursive)
Inputs and outputsParameter Type Required Description querystring No Search text matched against file name, metadata, and content. Not required when paginating with pageToken pageSizenumber No Maximum number of results to return (e.g., 10, 50, 100) pageTokenstring No Continuation URL from a previous response's nextPageToken, used to fetch the next page
Parameter Type Description successboolean Whether the search completed successfully filesarray Array of file and folder objects matching the search query nextPageTokenstring Token for retrieving the next page of results (optional)
Get metadata for a specific OneDrive file or folder by ID, or the drive root
Inputs and outputsParameter Type Required Description fileIdstring No The ID of the file or folder to retrieve (e.g., "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36M"). Leave empty to get the drive root folder
Parameter Type Description successboolean Whether the item metadata was retrieved fileobject The file or folder metadata, including id, name, webViewLink, size, and timestamps
Get information about the OneDrive drive, including storage quota
Inputs and outputsParameter Type Required Description
Parameter Type Description successboolean Whether the drive info was retrieved driveIdstring The ID of the drive driveTypestring The type of drive (e.g., "personal", "business") webUrlstring URL to the drive in the browser ownerstring Display name of the drive owner quotaobject Storage quota information in bytes (total, used, remaining, deleted, state)
Move a file or folder to a new parent folder, rename it, or both
Inputs and outputsParameter Type Required Description fileIdstring Yes The ID of the file or folder to move or rename destinationFolderIdstring No The ID of the destination parent folder (omit to only rename in place) newNamestring No The new name for the file or folder (omit to only move)
Parameter Type Description successboolean Whether the move or rename was successful fileobject The updated file object with its new name and/or parent folder
Copy a file or folder to another location within OneDrive
Inputs and outputsParameter Type Required Description fileIdstring Yes The ID of the file or folder to copy destinationFolderIdstring Yes The ID of the destination parent folder destinationFileNamestring No Optional new name for the copy (defaults to the original name)
Parameter Type Description successboolean Whether the copy request was accepted sourceFileIdstring The ID of the file or folder that was copied namestring The requested name for the copy, if provided monitorUrlstring URL to poll for the status of the asynchronous copy operation (copy completes in the background)
Create a view or edit sharing link for a OneDrive file or folder
Inputs and outputsParameter Type Required Description fileIdstring Yes The ID of the file or folder to share linkTypestring No Type of link to create: "view" (read-only), "edit" (read-write), or "embed" linkScopestring No Who can use the link: "anonymous" (anyone), "organization" (tenant members), or "users" (specific people)
Parameter Type Description successboolean Whether the sharing link was created successfully linkobject The created sharing link, including its type, scope, and URL
Delete a file or folder from OneDrive
Inputs and outputsParameter Type Required Description fileIdstring Yes The ID of the file or folder to delete (e.g., "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36M")
Parameter Type Description successboolean Whether the file was deleted successfully deletedboolean Confirmation that the file was deleted fileIdstring The ID of the deleted file