Graph API permanentDelete sends files to the SharePoint recycle bin

Fernando J. Belizón 20 Reputation points
2025-02-04T13:46:55.25+00:00

Good afternoon.

We have a problem deleting files from SharePoint using Graph API.

The context is a document management application that externally handles files located on SharePoint sites. This application uses the endpoint ‘POST /drives/{drive-id}/items/{item-id}/permanentDelete’ to delete files from SharePoint without sending them to the first or second level recycle bin.

The problem is that we have detected that in massive executions (around 300K permanent delete requests) there are some cases (around 20 files) where files deleted with ‘POST /drives/{drive-id}/items/{item-id}/permanentDelete’ are sent to the SharePoint recycle bin (first or second level).

How is this possible? What is the internal operability of the endpoint?

Thanks in advance, Fernando

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,954 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Akhil Nasalwai - MSFT 175 Reputation points Microsoft Vendor
    2025-02-04T18:19:25.41+00:00

    Hello Fernando J. Belizón,

    Thank you for reaching out to Microsoft!!

    For the issue mentioned when deleting the items from SharePoint, I tried replicating it and the items which are deleted permanently are not found in any of the recycle bins.

    delete permanently item

    Please try again once in test environment and if the issue still persists, I recommend you raising a support case with Microsoft Graph, a Support Engineer will be able to look into this issue and assist you better. You can raise support ticket from New support request - Microsoft Entra admin center or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Fernando J. Belizón 20 Reputation points
    2025-02-05T08:00:59.1166667+00:00

    If you test from Microsoft Graph with a single request you will not reproduce the problem. As I told you, the problem occurs in 20 requests out of 300000 requests launched in a massive process.

    I will pass the problem to the Microsoft Graph team. Thank you.

    0 comments No comments

  3. Fernando J. Belizón 20 Reputation points
    2025-02-05T08:21:33.94+00:00

    If you test from Microsoft Graph with a single request you will not reproduce the problem. As I told you, the problem occurs in 20 requests out of 300000 requests launched in a massive process.

    I will pass the problem to the Microsoft Graph team. Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.