You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Bucket Tag
PutBucketTagging
Copy page
Download PDF
PutBucketTagging
Introduction​
This interface is used to set tags for a bucket. By setting bucket tags, you can categorize and manage buckets. For example, you can add certain cost tags to the bucket, which will then be included in the billing statements generated by this bucket, enabling detailed classification filtering and more thorough cost analysis of detailed statements.​
Precautions​
Only the owner of the storage bucket and users with PutBucketTagging permission can create bucket tags.​
Tag setting rules​
​
Category​
Description​
Tag key​
  • Supports letters or characters from any language (such as Chinese, English letters, etc.), numbers, spaces; supports special characters: _.:/=+-@.​
  • volc: and sys: are reserved tag keys for the system, the beginning of the tag key cannot be set to any form of volc: or sys: in upper or lower case.​
  • The length of the tag key must be between 1 to 128 characters.​
Tag value​
  • Supports letters or characters from any language (such as Chinese, English letters, etc.), numbers, spaces; supports special characters: _.:/=+-@.​
  • The length of the tag value must be between 0 to 256 characters, meaning the tag value can be empty.​
Tag quantity​
  • There is no limit to the total number of tags, but each bucket can have a maximum of 50 tags attached.​
​
Request syntax​
​
PUT /?tagging HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: GMT Date​
Content-MD5: OolRtfRnEQlFUQVcEd5Q****​
Content-Length: 262​
Authorization: authorization string​
​
{​
"TagSet": {​
"Tags": [{​
"Key": "key1",​
"Value": "value1"​
}, {​
"Key": "key2",​
"Value": "value2"​
}]​
}​
}​
​
Request parameters and headers​
The request requires setting the Content-MD5 value of the request element in the message header to compare with the MD5 value of the uploaded request element. If they do not match, an error will be returned. For other common request headers used, please refer to Common parameters.​
​
Name​
Location​
Type​
Required​
Sample value​
Description​
tagging​
Query​
String​
Yes​
-​
A special identification for the PutBucketTagging request.​
​
Request body elements​
​
Name​
Type​
Required​
Sample value​
Description​
TagSet​
Object​
Yes​
-​
Bucket label collection information.​
Tags​
Array​
Yes​
-​
Bucket label list information.​
Key​
String​
Yes​
owner​
Value of the tag key. For specific setting rules, please see Tagging buckets.​
Value​
String​
Yes​
zhangsan​
Value of the tag value. For specific setting rules, please see Tagging buckets.​
​
Response headers​
This request returns the common response message headers, please see Common parameters.​
Response body elements​
There is no message element in this request response.​
Sample request​
​
PUT /?tagging HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: GMT Date​
Content-MD5: ContentMD5​
Authorization: authorization string​
​
{​
"TagSet": {​
"Tags": [{​
"Key": "key1",​
"Value": "value1"​
}, {​
"Key": "key2",​
"Value": "value2"​
}]​
}​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
Date: Sat, 07 Oct 2023 09:02:23 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
Content-Length: 0​
​
​
Last updated: 2026.08.10 10:31:21