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

Creating Tags in Batches

Function

This API is used to create tags in batches.

Calling Method

For details, see Calling APIs.

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

    asm:mesh:tagResource

    Tagging

    mesh *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

    -

    • g:TagKeys

    • g:RequestTag/<tag-key>

URI

POST /v2/{projectid}/{resourcetype}/{resourceid}/tags/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

projectid

Yes

String

Project ID

resourcetype

Yes

String

Resource type. Currently, only asm-mesh is supported.

resourceid

Yes

String

Resource ID (mesh ID)

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format)

Range:

  • application/json;charset=utf-8: The content is in JSON format and encoded using UTF-8.

  • application/json: The content is in JSON format.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

tags

No

Array of resource_tag 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 resource_tag objects

System tag list

Only used for system tags

Table 4 resource_tag

Parameter

Mandatory

Type

Description

key

Yes

String

Key. It can contain a maximum of 128 characters.

The key must comply with specifications described in 3.1 Character Set Specifications for Key.

value

Yes

String

Value. Each value can contain a maximum of 255 characters. The value must comply with specifications described in 3.2 Character Set Specifications for Value.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

-

String

The tags are created.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

The tags are created.

400

Failed to create the tags due to incorrect parameters.

500

Internal error.

Error Codes

See Error Codes.