All Products
Search
Document Center

Drive and Photo Service:FilePutUserTags

Last Updated:May 27, 2026

Adds custom tags to a file.

Operation description

This operation performs an incremental update:

  • If a tag with the same key already exists, its value is overwritten.

  • If a tag does not exist, it is added.

  • Existing tags with different keys are not affected.

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/file/put_usertags HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

domain_id

string

Yes

body

object

No

The request body.

drive_id

string

Yes

The drive ID.

1

file_id

string

Yes

The file ID.

9520943DC264

user_tags

array<object>

Yes

The array of tags to add. The array must contain 1 to 1,000 tags and must not contain duplicate tag keys.

object

Yes

The combined length of the tag key and tag value cannot exceed 2,000 bytes.

key

string

Yes

The tag key. Must not be empty or contain the # character.

tag

value

string

No

The tag value. Must not contain the # character.

value

Response elements

Element

Type

Description

Example

object

The response schema.

file_id

string

The file ID.

9520943DC264

Examples

Success response

JSON format

{
  "file_id": "9520943DC264"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.