Updated on 2026-03-06 GMT+08:00

Deleting Object Tags

Functions

This operation deletes tags from an object.

If you do not specify a version ID in a request, make sure that you have the DeleteObjectTagging permission. If you do specify a version ID in a request, make sure that you have the DeleteObjectTagging and DeleteObjectVersionTagging permissions. By default, only the object owner can perform this operation. The object owner can grant this permission to others by using a bucket or user policy.

OBS deletes tags from the current object version by default. You can use the versionId parameter to delete tags from any other version. If the version you are deleting tags from is a delete marker, OBS returns 404 Not Found.

Tags are not supported for files in parallel file systems.

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

Request Parameters

Table 1 describes the parameters in the request.

Table 1 Request parameters

Parameter

Description

Mandatory (Yes/No)

tagging

Indicates an object tag request.

Type: string

Yes

versionId

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

Type: string

No

Request Headers

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

Request Elements

This request involves no elements.

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 request uses common headers. For details, see Table 3.

Response Elements

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