Deleting Bucket Tags

Last Updated At: 2025-10-21 09:10:00

Description

COS allows you to delete tags for an existing bucket. The DELETE Bucket tagging API is used to delete existing bucket tags under a specified bucket.

Note:

If you are using a sub-account to call this API, please ensure that you have obtained permission for DELETE Bucket tagging from the root account.

Request

Request Example

DELETE /?tagging HTTP 1.1
Host:<BucketName-APPID>.<Endpoint>
Date:date
Authorization: Auth String

Note:

Authorization: Auth String (For details, see Request Signature documentation).

Request Header

Common Headers

This request operation implementation uses common request headers. For details on common request headers, please refer to the Common Request Headers document.

Non-common Headers

This request has no special request header information.

Request Body

The request body of this request is empty.

Response

Response Headers

Common Response Headers

This response uses common response headers. For details on common response headers, please refer to the Common Response Headers document.

Special Response Headers

This request has no special response header information.

Response Body

This request does not have any specific response body information.

Error Code

The following describes some special but common errors that may occur with this request:

Error Code Description HTTP Status Code
SignatureDoesNotMatch If this error code is returned, it means the provided signature is incorrect. 403 Forbidden
NoSuchBucket If this error code is returned, it means the bucket you want to add the rule to is not found. 404 Not Found
NoSuchTagSetError The bucket requested does not have any bucket tags set. 404 Not Found

Practical Case

Request

The following request applies to delete the existing tag information under the bucket examplebucket-1250000000. After parsing this request, COS deletes all tags under the bucket.

DELETE /?tagging HTTP/1.1
User-Agent: curl/7.29.0
Accept: */*
Host: examplebucket-1250000000.cos.city.yfm4.fsphere.cn
Authorization: q-sign-algorithm=sha1&q-ak=AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&q-sign-time=1516361923;1517361973&q-key-time=1516361923;1517361973&q-url-param-list=tagging&q-header-list=content-md5;host&q-signature=71251feb4501494edcfbd01747fa873003759404
Content-Md5: LIbd5t5HLPhuNWYkP6qHcQ==
Content-Length: 127
Content-Type: application/xml

Response

HTTP/1.1 204 No Content
Content-Type: application/xml
Connection: close
Date: Fri, 19 Jan 2018 11:40:22 GMT