Deleting Object Tags

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

Description

The DELETE Object tagging API is used to delete existing object tags for a specified object.
If you use a sub-account to call this API, please make sure you have obtained the permission for DELETE Object tagging API at the root account.
Version Control
If your bucket has versioning enabled and you need to delete tags for a specific versioned object, you can include the VersionId parameter in the request. This will delete the object tags set for the specified version ID.

Request

Request Example

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

Description

  • indicates the bucket name with APPID as the suffix, for example, examplebucket-1250000000.
  • Authorization: Auth String (For details, refer to Request Signature).

Request Parameters

Name Description Type Required
versionId When versioning is enabled, specify the version ID of the object to be manipulated. If not specified, the tags of the latest version of the object will be deleted. string No

Request Header

This API only uses common request headers. For details, see Common Request Headers documentation.

Request Body

The request body of this request is empty.

Response

Response Headers

This API only returns the public response header. For details, see Common Response Headers documentation.

Response Body

This request does not have any specific response body information.

Error Code

This API follows unified error response and error codes. For details, please refer to the Error Codes document.

Practical Case

Case One: Deleting Object Tags (Versioning Not Enabled)

Request

The following request deletes existing tags from the object exampleobject.txt in the bucket examplebucket-1250000000. After parsing this request, COS deletes all tags in the object.

DELETE /exampleobject.txt?tagging HTTP/1.1
User-Agent: curl/7.29.0
Accept: */*
Host: examplebucket-1250000000.cos.city.yfm4.fsphere.cn
Authorization: Auth String
Content-Length: 0
Content-Type: application/xml

Response

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

Case Two: Deleting Object Tags (Versioning Enabled)

Request

The following request deletes existing tags from the object exampleobject.txt in the bucket examplebucket-1250000000, specifying the version ID of the object as MTg0NDUxNTgwODg2MTEzMTQyOTI. After parsing this request, COS deletes all tags in the object of this version.

DELETE /exampleobject.txt?tagging&VersionId=MTg0NDUxNTgwODg2MTEzMTQyOTI  HTTP/1.1
User-Agent: curl/7.29.0
Accept: */*
Host: examplebucket-1250000000.cos.city.yfm4.fsphere.cn
Authorization: Auth String
Content-Length: 0
Content-Type: application/xml

Response

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