Updated on 2025-11-06 GMT+08:00

Obtaining the Identity Information of a Caller

Function

This API is used to obtain the identity information of a caller (such as a user or agency).

Authorization Information

No identity policy-based permission required for calling this API.

URI

GET /v5/caller-identity

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

When an API is called using a temporary security credential, the HTTP request header X-Security-Token must be provided. The value is the security_token field of the temporary security credential.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

account_id

String

Account ID.

Maximum: 64

principal_urn

String

Principal URN.

Minimum: 4

Maximum: 1024

principal_id

String

Principal ID.

Minimum: 2

Maximum: 256

Status code: 500

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Obtaining the identity information of a caller

GET https://{endpoint}/v5/caller-identity

Example Responses

Status code: 200

Successful

{
  "account_id" : "27680d67da6b47eb82d00a1a118be145",
  "principal_urn" : "iam::27680d67da6b47eb82d00a1a118be145:user:user-name",
  "principal_id" : "user-id"
}

Status Codes

Status Code

Description

200

Successful

500

Server error

Error Codes

See Error Codes.