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

Adding Tags

Function

This API is used to add tags.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

POST /v1/{project_id}/{resource_type}/{resource_id}/tags/action

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

resource_type

Yes

String

Specifies the resource type.

cph-server: cloud phone server

resource_id

Yes

String

Specifies the resource ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Indicates an operation.

  • create

tags

Yes

Array of Tag objects

Specifies the tag list.

Table 4 Tag

Parameter

Mandatory

Type

Description

key

Yes

String

Specifies the tag key.

  • A key can contain a maximum of 127 Unicode characters.

  • A key cannot be left blank, start or end with a space, nor start with sys. A key can contain letters, digits, spaces, and special characters _.:=+-@ of any language.

value

Yes

String

Specifies the list of tag values.

  • Each tag value can contain a maximum of 255 Unicode characters.

  • A tag value cannot be left blank nor start or end with a space. It can contain letters, digits, spaces, and special characters _.:=+-@.

Response Parameters

Status code: 204

No Content

None

Example Requests

Adding tags

Post https://{CPH Endpoint}/v1/{project_id}/{resource_type}/{resource_id}/tags/action

{
  "action" : "create",
  "tags" : [ {
    "key" : "key1",
    "value" : "value1"
  }, {
    "key" : "key2",
    "value" : "value2"
  } ]
}

Example Responses

None

Status Codes

Status Code

Description

204

No Content

Error Codes

See Error Codes.