Updated on 2025-09-15 GMT+08:00

Associating Key Alias

Function

This API is used to associate an alias.

You can associate an existing alias to another key.

Calling Method

For details, see Calling APIs.

URI

POST /v1.0/{project_id}/kms/alias/associate

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. It can be obtained by calling the 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

alias

Yes

String

Alias to be associated

target_key_id

Yes

String

ID of the key to be associated

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

domain_id

String

Account ID

key_id

String

Key ID

alias

String

Alias

alias_urn

String

Alias resource locator

create_time

String

Creation time

update_time

String

Update time

Example Requests

Associate kms-1234 to the bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e key.

{
  "target_key_id" : "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
  "alias" : "kms-1234"
}

Example Responses

Status code: 200

Response body for associating an alias

{
  "domain_id" : "3bab8e245e854f68af5967c00dd43127",
  "key_id" : "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
  "alias" : "kms-1234",
  "alias_urn" : "kms:cn-north-7:3bab8e245e854f68af5967c00dd43127:alias:kms-1234",
  "create_time" : "2024-04-01T00:00:00Z",
  "update_time" : "2024-04-01T00:00:00Z"
}

Status Codes

Status Code

Description

200

Response body for associating an alias

Error Codes

See Error Codes.