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

Deleting a Resource Tag

Function

This API is used to remove specific tags from resources (such as models, datasets, and services). For example, in resource management or classification, you can delete tags to adjust or clear resource metadata. By calling this API, you can delete specified tags in batches. You must have sufficient permissions and the target resource must exist. After the tags are deleted successfully, the resources do not contain the specified tags. If the deletion fails, an error message is returned. Common exceptions include permission verification errors, resource non-existence errors, and parameter verification errors.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    modelarts::unTagResource

    Tagging

    service *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    modelarts:tag:delete

    -

    -

    • g:RequestTag/<tag-key>

    • g:TagKeys

URI

DELETE /v2/{project_id}/modelarts-service-v2/{resource_id}/tags/delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID and Name.

Constraints

N/A

Range

Project ID.

Default Value

N/A

resource_id

Yes

String

Definition

ID of the resource whose tags are to be created.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

workspace_id

No

String

Definition

Workspace ID. workspaceId will be set to null.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

No

String

Definition

Message body type or format.

Constraints

N/A

Range

  • application/json

  • application/json;charset=utf-8

Default Value

N/A

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

tags

Yes

Array of TmsTagForDelete objects

Definition

Tags to be deleted.

resource_id

No

String

Definition

ID of the resource whose tags are to be deleted.

Range

N/A

Table 5 TmsTagForDelete

Parameter

Mandatory

Type

Description

key

Yes

String

Definition

TMS tag key.

Constraints

N/A

Range

N/A

Default Value

N/A

value

No

String

Definition

TMS tag value. This parameter is optional.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 204

The deletion is successful.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Example Requests

Delete resource tags.

https://{endpoint}/v2/{project_id}/modelarts-service/a55eba18-1ebf-4e9a-8229-d2d3b593a3dc/tags/delete

{
  "tags" : [ {
    "key" : "dev",
    "value" : "dev1"
  } ]
}

Example Responses

None

Status Codes

Status Code

Description

204

The deletion is successful.

400

Invalid request parameter.

401

Authentication failed.

403

Insufficient permissions.

404

The resource does not exist.

Error Codes

See Error Codes.