Help Center> IAM Identity Center> API Reference> API> Tag Management> Adding Tags to the Specified Resource
Updated on 2024-04-10 GMT+08:00

Adding Tags to the Specified Resource

Function

This API is used to add one or more tags to the specified resource. Currently, tags can only be attached to permission sets.

URI

POST /v1/instances/{resource_type}/{resource_id}/tags/create

Table 1 Path parameters

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Resource type

Enumerated value:

  • identitycenter:permissionset (permission set)

resource_id

Yes

String

Unique ID of a permission set

Maximum length: 130

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required.

Maximum length: 2048

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

tags

Yes

Array of objects

A key-value pair used to manage resources

Array length: 0 - 50

Table 4 tags

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key

Minimum length: 1

Maximum length: 128

value

Yes

String

Tag value, which can be empty but cannot be null

Minimum length: 0

Maximum length: 255

Response Parameters

Status code: 400

Table 5 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

request_id

String

Unique ID of a request

Status code: 403

Table 6 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

request_id

String

Unique ID of a request

Status code: 409

Table 7 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

request_id

String

Unique ID of a request

Example Request

Adding tags to the specified resource

POST https://{hostname}/v1/instances/{resource_type}/{resource_id}/tags/create

{
  "tags" : [ {
    "key" : "keystring",
    "value" : "valuestring"
  } ]
}

Example Response

None

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.