DELETE Object tagging

Last updated: 2024-11-22 11:34:01

Feature Overview

This API (DELETE Object tagging) is used to delete the existing tags of an object.
If a sub-account needs to call this API (DELETE Object tagging), ensure that the root account has authorized it to do so.
Versioning
If you have enabled versioning for the bucket and want to delete tags from an object of a specific version, include the VersionId parameter in the request.

Requests

Sample Request

DELETE /<ObjecKey>?tagging&VersionId=VersionId HTTP 1.1
Host:<BucketName-APPID>.cos.<Region>.myqcloud.com
Date:date
Authorization: Auth String
Note
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name with the APPID suffix, such as examplebucket-1250000000. You can refer to the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Convention documentation. <Region> represents the available regions for COS, which can be found in the Regions and Access Domain Names documentation.
Authorization: Auth String (For more information, see Request Signature.)

Request Parameters

Name
Description
Local Disk Types
Required
versionId
Version ID of the object (if versioning is enabled). If this parameter is not specified, tags of the latest-version object will be deleted.
string
Not required

Request Header

This API only uses Common Request Headers.

Request Body

The request body of this request is empty.

Response

Response Header

This API only returns Common Response Headers.

Response Body

No special response body is returned for this request.

Error Codes

This API returns common error responses and error codes. For more information, see Error Codes.

Examples

Sample 1: deleting object tags (with versioning disabled)

Requests

The following example deletes all existing tags from the exampleobject.txt object in the examplebucket-1250000000 bucket:
DELETE /exampleobject.txt?tagging HTTP/1.1
User-Agent: curl/7.29.0
Accept: */*
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
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

Sample 2: deleting object tags (with versioning enabled)

Requests

The following example deletes all existing tags from the exampleobject.txt object whose version ID is MTg0NDUxNTgwODg2MTEzMTQyOTI in the examplebucket-1250000000 bucket:
DELETE /exampleobject.txt?tagging&VersionId=MTg0NDUxNTgwODg2MTEzMTQyOTI HTTP/1.1
User-Agent: curl/7.29.0
Accept: */*
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
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