MS OneDrive Business icon

MS OneDrive Business

Access MS OneDrive for Business and SharePoint

File → Delete

AI-generated

Summary

Delete a file from OneDrive Business storage

Inputs

  • driveType — Type of drive to access (user, site, or sharedLink)
  • sharedLinkUrl (required) — Shared folder URL when driveType is sharedLink
  • userId — Email or ID of the user; leave empty to use the authenticated user
  • siteId (required) — SharePoint site identifier or URL
  • fileSelection — How to specify the file (browse, path, id, or link)
  • fileSharingUrl (required) — Sharing link to the file when fileSelection is link
  • browseFolder1 (required) — First level folder to navigate in browse mode
  • browseFolder2 — Second level folder (shown only if Level 1 is a folder)
  • browseFolder3 — Third level folder (shown only if Level 2 is a folder)
  • browseFolder4 — Fourth level folder (shown only if Level 3 is a folder)
  • browseFolder5 — Fifth level folder (shown only if Level 4 is a folder)
  • filePath (required) — Full path to the file from the drive root
  • fileId (required) — Unique ID of the file

Output shape

a single object containing a success boolean indicating the deletion succeeded

Only the success field is returned; no file metadata or other data is included.

Examples

Example 1: Delete a file using its ID in a user drive

driveType=user&fileId=01ABC123...&operation=delete

Example 2: Delete a file referenced by a sharing link

driveType=sharedLink&fileSelection=link&fileSharingUrl=https://1drv.ms/...&operation=delete

Example 3: Delete a file in a SharePoint site using its path

driveType=site&siteId=/sites/TeamSite&filePath=/Documents/myfile.pdf&operation=delete

Links

Discussion