tencent cloud

Smart Media Hosting

Updating File Tag or Category

PDF
Focus Mode
Font Size
Last updated: 2026-01-07 14:15:09

Description

Tags for updating files or categorization.
Note:
Requires admin permissions or spaceAdmin permissions. For details on permissions, see Generate Access Token Interface.

Request

Request Example

POST /api/v1/directory/{LibraryId}/{SpaceId}/{FilePath}?update&access_token={AccessToken}

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 details, see create tenant space.
String
No
FilePath
File path
String
No
AccessToken
Access token. For Public Read Media Library or tenant space, this parameter is not specified. Otherwise, you must specify this parameter. For details, see generate access token.
String
Yes

Request Body

{
"labels": ["animal", "elephant", "Asian elephant"],
"category": "image",
"localCreationTime": "2022-07-26T02:58:09Z",
"localModificationTime": "2022-07-26T02:58:09Z"
}
Request body field description:
Request parameters.
Description
Type
Required or Not
labels
File tag list, such as elephant
String Array
No
category
Customized category of files, with a maximum length of 16 bytes. Users can modify file classification through the file API or select based on file suffix to predefine classification information.
String
No
localCreationTime
The local creation time of the file, a timestamp string
String
No
localModificationTime
The local modification time of the file, a timestamp string
String
No

Response

Response code

Successful retrieval, returns HTTP 204 NO CONTENT.

Response Body

This request has no response body.

Error Codes

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

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback