Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Delete recycleBinItem objects permanently from the recycleBin of a fileStorageContainer. Items deleted by this method can't be restored.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
❌ |
❌ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type |
Least privileged permission |
Higher privileged permissions |
Delegated (work or school account) |
FileStorageContainer.Selected |
Not supported. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
FileStorageContainer.Selected |
Not supported. |
Note
In addition to Microsoft Graph permissions, your app must have the necessary container type-level permission or permissions to call this API. For more information, see container types. To learn more about container type-level permissions, see SharePoint Embedded authorization.
HTTP request
POST /storage/fileStorage/containers/{containerId}/recycleBin/items/delete
Request body
In the request body, supply a JSON representation of the parameters.
The following table shows the parameters that you can use with this action.
Parameter |
Type |
Description |
ids |
String collection |
The IDs of the recycleBinItem objects to delete. Required. |
Response
If successful, this method returns a 204 No Content
response code.
Examples
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/recycleBin/items/delete
Content-Type: application/json
{
"ids": ["5d625d33-338c-4a77-a98a-3e287116440c", "73133853-48f2-4956-bc4a-03f8d1675042"]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Storage.FileStorage.Containers.Item.RecycleBin.Items.Delete;
var requestBody = new DeletePostRequestBody
{
Ids = new List<string>
{
"5d625d33-338c-4a77-a98a-3e287116440c",
"73133853-48f2-4956-bc4a-03f8d1675042",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Storage.FileStorage.Containers["{fileStorageContainer-id}"].RecycleBin.Items.Delete.PostAsync(requestBody);
mgc-beta storage file-storage containers recycle-bin items delete post --file-storage-container-id {fileStorageContainer-id} --body '{\
"ids": ["5d625d33-338c-4a77-a98a-3e287116440c", "73133853-48f2-4956-bc4a-03f8d1675042"]\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphstorage "github.com/microsoftgraph/msgraph-beta-sdk-go/storage"
//other-imports
)
requestBody := graphstorage.NewDeletePostRequestBody()
ids := []string {
"5d625d33-338c-4a77-a98a-3e287116440c",
"73133853-48f2-4956-bc4a-03f8d1675042",
}
requestBody.SetIds(ids)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Storage().FileStorage().Containers().ByFileStorageContainerId("fileStorageContainer-id").RecycleBin().Items().Delete().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.storage.filestorage.containers.item.recyclebin.items.delete.DeletePostRequestBody deletePostRequestBody = new com.microsoft.graph.beta.storage.filestorage.containers.item.recyclebin.items.delete.DeletePostRequestBody();
LinkedList<String> ids = new LinkedList<String>();
ids.add("5d625d33-338c-4a77-a98a-3e287116440c");
ids.add("73133853-48f2-4956-bc4a-03f8d1675042");
deletePostRequestBody.setIds(ids);
graphClient.storage().fileStorage().containers().byFileStorageContainerId("{fileStorageContainer-id}").recycleBin().items().delete().post(deletePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const _delete = {
ids: ['5d625d33-338c-4a77-a98a-3e287116440c', '73133853-48f2-4956-bc4a-03f8d1675042']
};
await client.api('/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/recycleBin/items/delete')
.version('beta')
.post(_delete);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Storage\FileStorage\Containers\Item\RecycleBin\Items\Delete\DeletePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DeletePostRequestBody();
$requestBody->setIds(['5d625d33-338c-4a77-a98a-3e287116440c', '73133853-48f2-4956-bc4a-03f8d1675042', ]);
$graphServiceClient->storage()->fileStorage()->containers()->byFileStorageContainerId('fileStorageContainer-id')->recycleBin()->items()->delete()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.storage.filestorage.containers.item.recyclebin.items.delete.delete_post_request_body import DeletePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeletePostRequestBody(
ids = [
"5d625d33-338c-4a77-a98a-3e287116440c",
"73133853-48f2-4956-bc4a-03f8d1675042",
],
)
await graph_client.storage.file_storage.containers.by_file_storage_container_id('fileStorageContainer-id').recycle_bin.items.delete.post(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content