All Products
Search
Document Center

Drive and Photo Service:FilePutUserTags

Last Updated:Aug 04, 2025

Adds custom tags to a file.

Operation description

This operation is an incremental update operation. Take note of the following items:

  • If a tag name specified in the request is the same as an existing tag name, the existing tag is overwritten.
  • If a tag name specified in the request is different from the existing tag names, the specified tag is added.
  • The existing tags with unique names are not affected.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/file/put_usertags HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

drive_idstringYes

The drive ID.

1
file_idstringYes

The file ID.

9520943DC264
user_tagsarray<object>Yes

The tags to be added to the file. You cannot leave this parameter empty. You can specify up to 1,000 tags. You cannot specify tags that have the same name.

objectYes
keystringYes

The name of the tag. The tag name cannot be empty and cannot contain number signs (#).

tag
valuestringNo

The value of the tag. The tag value cannot contain number signs (#).

value

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

file_idstring

The file ID.

9520943DC264

Examples

Sample success responses

JSONformat

{
  "file_id": "9520943DC264"
}

Error codes

For a list of error codes, visit the Service error codes.