logo
search
Deleted File Recovery

How to Get Deleted SharePoint Files from Recycle Bin Using REST or Graph API

Maira MehtabMaira Mehtab Sep 20, 2026 868 views

Question details

The user needs to programmatically retrieve and manage deleted files from SharePoint document libraries using REST or Graph API endpoints.

Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Automating the retrieval, restoration, or permanent deletion of files from a SharePoint list or document library recycle bin.
Observed behavior
The goal is to list current recycle-bin items, track file deletions, and execute restore or delete actions via API calls.
Before you start

Ensure you have an active access token with the appropriate site collection administrator permissions or API scopes to authenticate your requests against your SharePoint environment.

Solution 1Recommended

Manage Deleted Files via SharePoint REST API

The SharePoint REST API provides comprehensive endpoints for listing, restoring, and permanently deleting items in the recycle bin.

For direct and detailed operations on the SharePoint recycle bin, the REST API is currently the most robust method compared to Microsoft Graph.

1
List Recycle Bin Items

Send an HTTP GET request to `/_api/web/recyclebin` to retrieve a list of all deleted files and their unique identifiers currently held in the recycle bin.

2
Restore a Specific File

To recover a file, send an HTTP POST request to `/_api/web/recyclebin('<recyclebinitemid>')/restore()` using the specific ID of the item obtained from the previous list.

3
Permanently Delete a File

To remove an item permanently, send an HTTP POST request to `/_api/web/recyclebin('<recyclebinitemid>')/deleteObject()`.

API Authentication: Remember to include necessary headers such as the Authorization bearer token and Accept format (e.g., application/json) in your REST calls.
Free Microsoft Office alternative

Looking for a Seamless and Free Document Management Solution?

While SharePoint offers robust API capabilities for enterprise document management, setting up API calls can be complex. If you need a lightweight, cost-effective alternative for team collaboration and document handling, consider WPS Office. It provides robust cloud integration and an intuitive user interface without a steep learning curve.

  1. 1. Download WPS Office: Visit the official WPS website to download the free installation package.
  2. 2. Install and Launch: Run the installer and follow the on-screen instructions to complete the setup.
  3. 3. Access Cloud Features: Sign in with your WPS account to sync files across devices and manage your documents easily.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Built-in cloud storage for easy file sharing, version history, and safe document recovery.Lightweight installation with an intuitive, user-friendly interface.Free to use for all essential office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use Microsoft Graph to restore SharePoint recycle bin items?

Currently, Microsoft Graph provides limited support for direct recycle bin operations. It is highly recommended to use the SharePoint REST API's restore endpoint for reliably recovering deleted files.

Do I need special permissions to access the recycle bin via API?

Yes, the account or application executing the API calls must have sufficient permissions, such as Site Collection Administrator privileges or the appropriate OAuth scopes, to view and modify recycle bin items.

How do I find the ID of a deleted item for the REST API?

You can locate the item ID by first sending a GET request to the `/_api/web/recyclebin` endpoint. The JSON response will contain a list of all deleted items along with their unique GUIDs, which you can use for subsequent restore or delete commands.