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

Adding CTS Resource Tags in Batches

Function

This API is used to add CTS resource tags in batches.

Calling Method

For details, see Calling APIs.

URI

POST /v3/{project_id}/{resource_type}/{resource_id}/tags/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining an Account ID and Project ID.

resource_type

Yes

String

CTS resource type. Currently, only cts-tracker is supported.

resource_id

Yes

String

Resource ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

tags

No

Array of ResourceTag objects

Tag list.

Table 3 ResourceTag

Parameter

Mandatory

Type

Description

key

No

String

Tag key. A tag key contains a maximum of 128 Unicode characters. It can contain letters, digits, spaces, and special characters _.:=+-@. It cannot start or end with a space, or start with sys.

value

No

String

Tag value. Each value contains a maximum of 255 Unicode characters. If value is specified, tags are deleted by key and value. If value is not specified, tags are deleted by key. A tag value can contain letters, digits, spaces, and special characters _.:/=+-@. It cannot start or end with a space.

Response Parameters

Status code: 200

Creation succeeded.

Status code: 401

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 404

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 503

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Example Requests

Create a tracker tag.

POST https://{endpoint}/v3/{project_id}/{resource_type}/{resource_id}/tags/create

{
  "tags" : [ {
    "key" : "111",
    "value" : "33"
  } ]
}

Example Responses

None

Status Codes

Status Code

Description

200

Creation succeeded.

401

The request is rejected due to authentication failure.

403

The server understood the request but refused to authorize it.

404

The requested resource does not exist.

500

Failed to complete the request because of an internal service error.

503

The requested service is invalid. The client should not repeat the request without modifications.

Error Codes

See Error Codes.