Updated on 2026-07-22 GMT+08:00

Querying the Account Password Policy

Function

This API is used to query the account password policy.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

iam:securitypolicies:getPasswordPolicyV5

Read

-

-

-

-

URI

GET /v5/password-policy

Request Parameters

None

Response Parameters

Status code: 200

Table 1 Response body parameters

Parameter

Type

Description

password_policy

password_policy object

Definition:

Password policy.

Range:

N/A

Table 2 password_policy

Parameter

Type

Description

maximum_consecutive_identical_chars

Integer

Definition:

The maximum number of times that a character is allowed to consecutively present in a password.

Range:

N/A

maximum_password_length

Integer

Definition:

Maximum number of characters that a password can contain.

Range:

N/A

minimum_password_age

Integer

Definition:

The minimum period (minutes) after which users are allowed to make a password change.

Range:

N/A

minimum_password_length

Integer

Definition:

The minimum number of characters that a password must contain.

Range:

N/A

password_reuse_prevention

Integer

Definition:

The number of previously used passwords that are not allowed.

Range:

N/A

password_not_username_or_invert

Boolean

Definition:

Whether the password can be the username or the username spelled backwards. The default value is true, indicating that the password cannot be the username or the username spelled backwards.

Range:

N/A

password_requirements

String

Definition:

Characters that a password must contain.

Range:

N/A

password_validity_period

Integer

Definition:

Password validity period (days).

Range:

N/A

password_char_combination

Integer

Definition:

Minimum number of character types that a password must contain.

Range:

N/A

allow_user_to_change_password

Boolean

Definition:

Whether to allow IAM users to change their own passwords. This parameter does not apply to the root user.

Range:

N/A

Status code: 403

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Definition :

Error code. For details, see Error Code.

Range:

The format is PAP5.XXXX, for example, PAP5.0012.

error_msg

String

Definition :

Error message. For details, see Error Message.

Range:

N/A.

request_id

String

Definition:

Unique identifier of an API request, which is used to locate API calling exceptions.

Range:

N/A

encoded_authorization_message

String

Definition :

Encrypted details returned when the authentication fails, which are used to locate authentication problems. The STS5 decryption API can be used for decryption. For details, see API link.

Range:

N/A.

Example Requests

Querying the account password policy

GET https://{endpoint}/v5/password-policy

Example Responses

Status code: 200

Successful

{
  "password_policy" : {
    "maximum_consecutive_identical_chars" : 0,
    "maximum_password_length" : 32,
    "minimum_password_age" : 0,
    "minimum_password_length" : 8,
    "password_reuse_prevention" : 1,
    "password_not_username_or_invert" : true,
    "password_requirements" : "A password must contain at least two of the following: uppercase letters, lowercase letters, digits, and special characters.",
    "password_validity_period" : 180,
    "password_char_combination" : 2,
    "allow_user_to_change_password" : true
  }
}

Status Codes

Status Code

Description

200

Successful

403

Forbidden

Error Codes

See Error Codes.