Updated on 2026-07-27 GMT+08:00

Deleting Object Tags

Function

This API deletes the tags from an object. For more information about object tags, see Object Tags.

Authorization

To call this API, you must be the object owner or have the permissions to delete object tags. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.

  • If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
    • If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you must have the obs:object:DeleteObjectTagging (versioning disabled) and obs:object:DeleteObjectVersionTagging (versioning enabled or suspended) permissions. For details, see Creating a Custom IAM Policy.
    • If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you must have the obs:object:deleteObjectTagging (versioning disabled) and obs:object:deleteObjectVersionTagging (versioning enabled or suspended) permissions, as shown in the following table. For details, see Creating a Custom IAM Identity Policy.

      Action

      Access Level

      Resource Type (*: Required)

      Condition Key

      Alias

      Dependencies

      obs:object:deleteObjectTagging (versioning disabled)

      obs:object:deleteObjectVersionTagging (versioning enabled or suspended)

      Tagging

      object *

      -

      -

      -

      • obs:EpochTime
      • obs:SourceIp
      • obs:TlsVersion
      • obs:CustomDomain
  • If you use bucket policies for authorization, you must have the obs:object:DeleteObjectTagging (versioning disabled) and obs:object:DeleteObjectVersionTagging (versioning enabled or suspended) permissions. For details, see Creating a Custom Bucket Policy.

URI

DELETE /{object_key}?tagging

Calling Method

For details, see Calling APIs. Before calling this API, calculate the API signature and add it to the request.

You can debug this API in API Explorer.

Request Syntax

1
2
3
DELETE /objectname?tagging&versionId=versionid  HTTP/1.1  
Date: date
Authorization: authorization string

URI Parameters

Table 1 describes the parameters in the request.

Table 1 URI parameters

Parameter

Mandatory

Type

Description

tagging

Yes

String

Definition

An identifier that marks this request as related to object tagging.

Constraints

N/A

Range

N/A

Default Value

N/A

versionId

No

String

Definition

Version ID of the object whose tags are to be deleted. The corresponding response header is x-obs-version-id. If the specified version is a delete marker, OBS returns 404 Not Found.

Constraints

N/A

Range

A string of 32 characters

Default Value

N/A

Request Headers

This request uses common headers. For details, see Table 3.

Request Body

This request contains no request body parameters.

Response Syntax

1
2
3
4
5
6
HTTP/1.1 status_code
x-obs-request-id: request id
x-obs-id-2: id
x-obs-version-id: version id
Content-Length: length
Date: date

Response Headers

This response uses common headers. For details, see Table 1.

Response Body

This response contains no elements.

Error Responses

No special errors. You can find all errors in Error Code Overview. If the object has no tags or the tag deletion is successful, OBS returns 204.

Sample Request

1
2
3
4
5
DELETE /objectname?tagging&versionId=G001018455096CE600005306000000DD HTTP/1.1   
User-Agent: curl/7.19.7    
Accept: */*   
Date: Wed, 27 Jun 2018 13:46:58 GMT   
Authorization: authorization string

Sample Response

1
2
3
4
5
6
HTTP/1.1 204 No Content 
x-obs-request-id: 0002B7532E0000015BEB2C212E53A17L 
x-obs-id-2: CqT+86nnOkB+Cv9KZoVgZ28pSgMF+uGQBUC68flvkQeq6CxoCz65wWFMNBpXvea4 
x-obs-version-id: G001018455096CE600005306000000DD
Content-Length: 0
Date: Wed, 27 Jun 2018 13:46:58 GMT

Using SDKs to Call APIs

You are advised to use OBS SDKs to call APIs. SDKs encapsulate APIs to simplify development. You can call SDK API functions to access OBS without manually calculating signatures.

Java: not supported

Python: not supported

C: not supported

Go: not supported

BrowserJS: not supported

.NET: not supported

Android: not supported

iOS: not supported

Node.js: not supported

Helpful Links