tencent cloud

Smart Media Hosting

Product Introduction
Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
Purchase Guide
Quick Start
Create Media Library
Initiate request
Service Level API Document
History
Introduction
API Category
Making API Requests
PaaS Service APIs
Official Cloud Disk APIs
Data Types
Error Codes
Business Level API Document
Introduction
Access Token Operation API
Tenant Space Operation API
File Operation API
Directory or Album Operation API
Recycle Bin Operation API
Quota Operation API
Query Task Operation API
Search Operation API
Historical Version Operations API
Directory and File Batch Operation API
Collection Operation API
Error Codes
SDK Documentation
Android SDK
iOS SDK
HarmonyOS SDK
FAQs
Enterprise Network Disk
Product Introduction
Purchase Guide
Quick Start
FAQs
Service Level Agreement
Glossary

Restore Designated Recycle Bin Items (Batch)

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-07 14:27:57

Description

Restore specified recycle bin projects (batch).
Note:
Required permissions: admin, space_admin, or restore_recycled. For details about permissions, see Generate Access Token API.
Ensure the directory where the item is located exists before restoring it.
When an item is restored, if a file with the same name exists, it will be renamed by default.

Request

Request Example

POST /api/v1/recycled/{LibraryId}/{SpaceId}?restore&access_token={AccessToken}&user_id={UserId}

Request Parameter

Request parameters.
Description
Type
Required or Not
LibraryId
Media Library ID, obtained after creating a media library in the media hosting console. Please refer to Create Media Library
String
Yes
SpaceId
Space ID. If the media library is in single-tenant mode, this parameter is fixed as hyphen (`-`); if the media library is in multi-tenant mode, you must specify this parameter. See Create Tenant Space
String
No
AccessToken
Access token. See Generate Access Token
String
Yes
UserId
User identity recognition. When the access token has admin permission and user identity recognition is empty when applying for access, it is used to temporarily specify user identity. For details, see Generate Access Token API
String
No
RestorePathStrategy
Restoration project source path processing method, defaults to originalPath, includes the following content:
Restore to original path. Error will be reported if original path does not exist.
fallbackToRoot: restore to original path, restore to root directory if original path not found
String
No

Request Body

application/json, a collection of recycledItemId for batch recovery.
Request body example:
[ 1, 2, 3, 4, 5 ]
Request body is an array, required parameter.

Response

Response code

Execution successful.
When recovering multiple projects asynchronously, return HTTP 202 Accepted.
When recovering fewer projects synchronously, return HTTP 200 OK (all execution successful) or HTTP 207 Multi-Status (part or all execution failed).

Response Body

application/json
Response body example:
Return HTTP 200 OK or HTTP 207 Multi-Status:
{
"result": [
{
"status": 200,
"path": [ "foo", "bar", "file (1).docx" ],
"recycledItemId": 1
},
{
"status": 404,
"code": "RecycledItemNotFound", // File does not exist
"message": "Recycled item not found.",
"recycledItemId": 2
},
{
"status": 404,
"code": "DirectoryNotFound", // Parent directory does not exist
"message": "Directory not found.",
"recycledItemId": 3
},
{
"status": 200, // A new directory is automatically created when restoring to an existing target directory
"path": [ "foo", "new_directory" ],
"recycledItemId": 4
},
{
"status": 404,
"code": "SourceFileNotFound", // Source file for symbolic link not found
"message": "Source file not found.",
"recycledItemId": 5
}
]
}
Return HTTP 202 Accepted:
{ "taskId": 20 }
[
{
"taskId": 20,
"status": 200,
"result": [
{ "status": 200, "path": [ "foo", "bar", "file (2).docx" ], "recycledItemId": 6 }
]
}
]
Response body field description:
Response Parameters
Description
Type
result.status
Status:
200: Recovery successful
Other: Recovery failed
String
result.path
Final file path
String Array
result.recycledItemId
Project ID of the recycle bin when making a request
String
taskId
Task ID when recovering asynchronously can be queried via the Query Task API to check the task status.
String
Query task response body field description:
Response Parameters
Description
Type
status
Status:
202: Task in progress
200: All executions successful
207: Part or all executions failed
String

Error Codes

This request operation has no special error messages. For common error messages, see Error Codes.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백