All Products
Search
Document Center

Drive and Photo Service:RestoreFile

Last Updated:Jul 20, 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 parameters.

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

Schema of Response

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 an empty string is returned, the file or folder is restored from the recycle bin directly.

If a non-empty string is returned, asynchronous processing is required. Call GetAsyncTask with this asynchronous task ID to retrieve the task information.

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.