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

Set Recycle Bin Lifecycle

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-01-07 14:27:58

Description

Set recycle bin lifecycle.
Note:
Required permissions: admin, space_admin. For details about permissions, see the Generate Access Token API.
The recycle bin lifecycle refers to the retention period for files after they are moved to the recycle bin. Once this period expires, files in the recycle bin will be automatically deleted and cannot be recovered thereafter.
When the recycle bin lifecycle is not set for a Tenant Space, the system will use the retention days of the recycle bin of the media library to which the Tenant Space belongs as the default value.
When the recycle bin lifecycle for a Tenant Space is set, the rules are as follows:
If the newly set retention days are longer than the original retention days, the retention days for files already in the recycle bin will be updated to the newly set value.
If the newly set retention days are shorter than the original retention days, files already in the recycle bin will retain the old retention days, and only files deleted afterwards will use the new retention days.

Request

Request Example

POST /api/v1/recycled/`{LibraryId}`/`{SpaceId}`?lifecycle&access_token=`{AccessToken}`

Request Parameter

Request parameters.
Description
Type
Required or Not
LibraryId
Media Library ID, obtain it after creating a media library in the media hosting console, see 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. For Public Read Media Library or tenant space, this parameter is not specified. Otherwise, you must specify this parameter. See generate access token.
String
No

Request Body

application/json
Request body example:
{
"retentionDays":10
}
Parameter
Description
Type
Required or Not
retentionDays
Recycle bin retention days. Requirement: 0 < retentionDays <= 10000.
Number
Yes

Response

Response code

Modification succeeded, return HTTP 204 No Content

Response Body

This response has no response body.

Error Codes

Potential error code SetRecycleLifecycleFrequencyLimit 403: Settings are too frequent. You can only set it once within 10 minutes. For common errors, see the Error Code document.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan