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

Querying the Account Password Policy

Function

This API is used to query the account password policy.

Authorization Information

Each account 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

PasswordPolicy object

Password policy.

Table 2 PasswordPolicy

Parameter

Type

Description

maximum_consecutive_identical_chars

Integer

Maximum number of consecutive identical characters.

maximum_password_length

Integer

Maximum number of characters that a password can contain.

minimum_password_age

Integer

Minimum password age (minute).

minimum_password_length

Integer

Minimum number of characters that a password must contain.

password_reuse_prevention

Integer

Number of recent passwords disallowed.

password_not_username_or_invert

Boolean

Whether to disallow the username or the username spelled backwards for passwords. The default value is true, indicating that the password cannot be the username or the username spelled backwards.

password_requirements

String

Characters that a password must contain.

password_validity_period

Integer

Password validity period (days).

password_char_combination

Integer

Minimum number of character types that a password must contain.

allow_user_to_change_password

Boolean

Indicates whether IAM users are allowed to change their passwords. This is not applicable to the root user.

Status code: 403

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

request_id

String

Request ID.

encoded_authorization_message

String

Encrypted authentication failure information, which can be decrypted using the STS5 decryption API.

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.