Skip to content

Set File Tags

Request

Replace the tags on a Cloud Storage file.

  • Preconditions: one fileId per call, and tagIds must be non-empty and reference Cloud Storage tags belonging to your team. Profile tags are rejected.
  • Effect: tags not present in the request are removed from the file and missing ones are added. There is no way to clear all tags here because an empty list is rejected.
  • Completion: synchronous and idempotent for the same body.

Documented business errors: 39011, 39048, 39049. See Error Codes for what each code means. Any operation can additionally return the common codes.

Bodyapplication/jsonrequired
fileIdstringrequired

Cloud storage file ID.

Example:"1800000000001001"
tagIdsArray of strings, non-emptyrequired

Tag IDs.

Example:
[ "1800000000000101", "1800000000000102" ]
POST
/api/cloudstorage/file/tag/set
curl -i -X POST \
  http://127.0.0.1:40000/api/cloudstorage/file/tag/set \
  -H 'Content-Type: application/json' \
  -d '{
    "fileId": "1800000000001001",
    "tagIds": [
      "1800000000000101",
      "1800000000000102"
    ]
  }'

Responses

Success

Bodyapplication/json
codeintegerrequired

Return result code. 0 means success; other codes indicate exceptions.

Example:0
msgstring or nullrequired

Error message.

Example:null
requestIdstring

Operation request ID. This field may be present when the request passes through the API gateway.

Example:"1d4f3ea968664593860b94b35d4ebf5e"
datanull
Example:null
Response
{ "code": 0, "msg": null, "requestId": "1d4f3ea968664593860b94b35d4ebf5e", "data": null }