All Products
Search
Document Center

Drive and Photo Service:RestoreFile

Last Updated:May 27, 2026

Restores a file or folder from the recycle bin.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /v2/recyclebin/restore HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

domain_id

string

Yes

body

object

No

The request body.

drive_id

string

Yes

The drive ID.

1

file_id

string

Yes

The file or folder ID.

4221bf6e6ab43a255edc4463bffa6f5f5d317401

Response elements

Element

Type

Description

Example

object

The response schema.

domain_id

string

The domain ID.

bj1

drive_id

string

The drive ID.

1

file_id

string

The file or folder ID.

4221bf6e6ab43a255edc4463bffa6f5f5d317401

async_task_id

string

The asynchronous task ID.

If this parameter is empty, the file or folder is restored synchronously.

If this parameter contains a value, the restore is asynchronous. You can then call the GetAsyncTask operation with this ID to query the task status.

4221bf6e6ab43c255edc4463bf3a6f5f5d317406

Examples

Success response

JSON format

{
  "domain_id": "bj1",
  "drive_id": "1",
  "file_id": "4221bf6e6ab43a255edc4463bffa6f5f5d317401",
  "async_task_id": "4221bf6e6ab43c255edc4463bf3a6f5f5d317406"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.