Updated on 2025-02-25 GMT+08:00

Creating a User Tag

Function

This API is used to create user tags.

URI

POST /v1/{project_id}/tags

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

project_id

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Obtain a user token by calling IAM's "Obtaining a User Token" API. X-Subject-Token in the response header is the desired user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

description

No

String

description

name

Yes

String

name

type

Yes

String

Explanation

Tag type, which can be user tag or user group tag.

Constraints

N/A

Value range

The enumerated values are:

  • user: user tag.
  • userGroup: user group tag.

Default value

N/A

default_value_type

Yes

String

Default tag value type. The default value is NULL.

  • NULL: Null.
  • ALL: All values.
  • ENUM: Enumerated values. default_value must be set to an enumerated value.

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

{Custom key}

Map<String,String>

  

Example Request

Create a user tag.

POST https://{endpoint}/v1/{project_id}/tags

{
  "name": "Test 20241127",
  "description": "Added for test",
  "type" : "user",
  "default_value_type" : "ENUM",
  "default_value": ["Test"]
}

Example Response

None

Status Codes

Status Code

Description

200

The user tag is successfully created.

Error Codes

See Error Codes.