Restore a driveItem that has been deleted and is currently in the recycle bin. NOTE: This functionality is currently only available for OneDrive Personal.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Not supported.
Delegated (personal Microsoft account)
Files.ReadWrite.All
Application
Files.ReadWrite.All
HTTP request
POST /me/drive/items/{item-id}/restore
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Request body
In the request body, provide a JSON object with the following parameters.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.Drives.Item.Items.Item.Restore.RestorePostRequestBody
{
ParentReference = new ItemReference
{
Id = "String",
},
Name = "String",
};
var result = await graphClient.Drives["{drive-id}"].Items["{driveItem-id}"].Restore.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new RestorePostRequestBody();
$parentReference = new ItemReference();
$parentReference->setId('String');
$requestBody->setParentReference($parentReference);
$requestBody->setName('String');
$result = $graphServiceClient->drives()->byDriveId('drive-id')->items()->byItemId('driveItem-id')->restore()->post($requestBody);