Restoring OneDrive Documents by Restore Operator

You can restore backed-up OneDrive documents using Restore Portal. For more information about Restore Portal, see the Data Restore Using Restore Portal section of the Veeam Backup for Microsoft 365 User Guide.

To restore data using Restore Portal, you must create a restore session for a restore operator. For more information, see Creating Restore Session for Restore Operator.

Request

POST https://<hostname>:4443/v6/RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Documents/operatorRestore

Request Headers

The request header must contain an authorization token of the current session.

Request Parameters

The following parameters must be specified in the URL of the request:

Parameter

Type

Description

restoreSessionId

string

Specifies the identification number of the restore session. For more information on how to get this parameter, see Getting Restore Sessions.

oneDriveId

string

Specifies the identification number of OneDrive. For more information on how to get this parameter, see Getting OneDrives.

Request Body

To restore backed-up OneDrive documents using Restore Portal, the request body must contain the following properties:

Property

Type

Description

documentAction

string

Specifies the action that will be performed in case the restore destination contains the restored document. The following values are available:

  • Overwrite
  • Keep

documentsRestoreConfigs

documentsRestoreConfigs[]

Specifies settings for document restore. For more information, see Document Restore Settings.

reason

string

Specifies a reason for the restore operation.

Document Restore Settings

The request body must contain the following properties:

Property

Type

Description

document

document

Specifies ID the document that you want to restore. For more information on how to get such IDs, see Getting OneDrive Documents.

documentVersion

string

Specifies what version of the OneDrive document will be restored. The following values are available:

  • All
  • Last

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns a response code 200 OK.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTPS headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the response body message for the requests with the export and save actions: application/octet-stream.

The media type and syntax of the response body message for the requests with the restore and send actions: null.

Response Body

The response body contains the following property:

Property

Type

Description

sessionId

string

Specifies the restore session ID.

Example

The example shows how to restore a OneDrive document using Restore Portal.

Request:

POST https://abc.tech.local:4443/v6/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/operatorRestore

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "documentAction": "Overwrite",

 "documentsRestoreConfigs": [

   {

     "document": {

       "id": "74685f6b-16aa-4a78-a44f-05526ce0ae30"

     },

     "documentVersion": "All"

   }

 ],

 "reason": "Restore of the deleted document"

}

 

Response:

200 OK

 

Response Body:

{

 "sessionId": "61954db6-7278-4d26-86f7-888bda5a4ec4"

}