Help Center/ IAM Identity Center/ API Reference/ API/ Tag Management/ Adding Tags to the Specified Resource
Updated on 2025-08-21 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. It can be called only from the organization's management account or from a delegated administrator account of a cloud service.

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

None.

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 Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.