Updated on 2025-10-29 GMT+08:00

This API is used to batch delete resource tags.

Function

This API is used to batch delete tags from a specified instance.

TMS may use this API to batch manage service resource tags.

Calling Method

For details, see Calling APIs.

URI

DELETE /v1/{project_id}/{resource_type}/{resource_id}/tags/delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Resource type.

resource_id

Yes

String

Resource ID.

project_id

Yes

String

Definition

Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-type

Yes

String

Definition

Content type.

  • application/json;charset=UTF-8: common API request type

Constraints

N/A

Range

  • application/json;charset=UTF-8

Default Value

N/A

X-Auth-Token

Yes

String

User token.

You can call the IAM API to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

tags

No

Array of ResourceTag objects

Tag list.

This field is mandatory when the tenant permission is used. For the op_service permission, choose either this field or sys_tags.

sys_tags

No

Array of ResourceTag objects

System tag list.

This field is available only to the op_service permission. Choose either this field or tags.

Currently, TMS invokes only one resource_tag structure. The key is fixed as _sys_enterprise_project_id.

The value is UUID or 0. 0 indicates the enterprise project by default. Only create is supported currently.

Table 4 ResourceTag

Parameter

Mandatory

Type

Description

key

Yes

String

Key. The value can contain a maximum of 128 Unicode characters.

The key complies with 3.1 KEY character set specifications.

value

Yes

String

Value. Each value can contain a maximum of 255 Unicode characters.

The value must comply with 3.2 VALUE character set specifications.

Response Parameters

Status code: 204

No Content

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

DELETE /v1/{project_id}/{resource_type}/{resource_id}/tags/delete

{
  "tags" : [ {
    "key" : "key1"
  }, {
    "key" : "key2",
    "value" : "value3"
  } ],
  "sys_tags" : [ {
    "key" : "_sys_enterprise_project_id",
    "value" : "5aa119a8-d25b-45a7-8d1b-88e127885635"
  } ]
}

Example Responses

None

Status Codes

Status Code

Description

204

No Content

400

Invalid tag parameter.

401

Authentication failed.

403

Insufficient permissions.

404

No resources found.

500

System error.

Error Codes

See Error Codes.