Updated on 2026-04-16 GMT+08:00

Deleting Object Tags

Functions

This API is used to delete the tags from an object. For more information about object tags, see Object Tags.

Authorization Information

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 need to grant 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 need to grant 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 need to grant the obs:object:DeleteObjectTagging (versioning disabled) and obs:object:DeleteObjectVersionTagging (versioning enabled or suspended) permissions. For details, see Creating a Custom Bucket Policy.

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

Description

Mandatory (Yes/No)

tagging

Indicates an object tag request.

Type: string

Yes

versionId

ID of the tagged object version. The corresponding response header is x-obs-version-id.

If the version is a delete marker, OBS returns 404 Not Found.

Type: string

No

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 error responses are returned. For details, see Table 2. If the object has no tags or the tag deletion is successful, OBS returns a 204 error.

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

PHP: not supported

Node.js: not supported

Helpful Links