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

Delete Catalog or Album

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

Description

Delete a catalog or album.
Note:
Required permissions: admin, space_admin, or delete_directory (when the recycle bin is not enabled or Permanent is 0)/delete_directory_permanent (when the recycle bin is enabled and Permanent is 1). For details about permissions, see Generate Access Token API.
If the recycle bin feature is enabled for the media library, this interface does not permanently delete directories or albums but moves them and their files into the recycle bin. You can permanently delete or restore the directories or albums in the recycle bin via related interfaces or directly empty the recycle bin.

Request

Request Example

DELETE /api/v1/directory/ {LibraryId}/{SpaceId}/{DirPath}?permanent={Permanent}&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, see create media library
String
Yes
SpaceId
Space ID. If the media library is in single-tenant mode, this parameter is fixed as a hyphen (-); if the media library is in multi-tenant mode, you must specify this parameter. For retrieval, see create tenant space.
String
No
DirPath
Directory path or album name. For multi-level directory, use slash (/) to separate, such as foo/bar
String
Yes
Permanent
When the media library enables the recycle bin, this parameter specifies whether to move the file to the Recycle Bin or permanently delete it. 1: permanently delete, 0: move to Recycle Bin. Default is 0.
String
No
AccessToken
Access token. To obtain it, see Generate Access Token
String
Yes
UserId
User identity recognition. When the access token corresponds to admin permission and the user identity recognition during token application is empty, it is used to temporarily specify user identity. For details, see Generate Access Token API
String
No

Request Body

This request does not have a request body.

Response

Response code

Deleted successfully, returns HTTP 204 No Content (Recycle Bin not enabled or permanent deletion enabled) or HTTP 200 OK (Recycle Bin enabled and moved to Recycle Bin).

Response Body

Empty, no response body (Recycle Bin not enabled or permanent deletion enabled) or application/json (Recycle Bin enabled and moved to Recycle Bin).
Response body example: (Enable Recycle Bin and move to Recycle Bin)
{
"recycledItemId": 123
}
Response body field description:
Response Parameters
Description
Type
recycledItemId
Recycle Bin project ID, used to permanently delete or restore a designated project from the Recycle Bin.
Int

Error Codes

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

도움말 및 지원

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

피드백