# Passwords API



<EndpointIndex names={['fetchPasswordPolicy', 'updatePasswordPolicy']} />

Fetch [#fetch]

Fetch Password Policy [#fetch-password-policy]

<ApiEndpoint name="fetchPasswordPolicy" />

<ApiSchema name="PasswordPolicyResponse" />

<ApiSchema name="PasswordPolicies" />

Update [#update]

Update Password Policy [#update-password-policy]

<ApiEndpoint name="updatePasswordPolicy" />

<ApiSchema name="PasswordPolicyUpdateRequest" />

<ApiSchema name="PasswordPoliciesUpdateRequest" />

<Callout type="warn">
  The <ApiLink name="updatePasswordPolicy" /> endpoint is a `PUT` endpoint, which means *all* the password policy settings will be replaced. If any properties are not included in the update request, the default values will be used.
</Callout>

See Also [#see-also]

* [Passwords Feature Guide](/features/security/password-policies)


## API Reference

GET /auth/identity/passwordPolicy — fetchPasswordPolicy
Permissions: read, custom
Responses:
  200 PasswordPolicyResponse — OK

PUT /auth/identity/passwordPolicy — updatePasswordPolicy
Permissions: add, custom
Request body (PasswordPolicyUpdateRequest):
Responses:
  200 — OK

PasswordPolicyResponse
Properties:
  passwordPolicies (PasswordPolicies, required)

PasswordPolicies
Properties:
  digits (integer, required) — The minimum number of numeric digits required in the password string.
  forceExpiredPasswordChange (integer, required) — The number of days the password is valid before a new password is required.
  length (integer, required) — The minimum number of characters allowed in the password.
  lowercase (integer, required) — The minimum number of uppercase characters required in the password string.
  maxLength (integer, required) — The maximum number of characters allowed in the password.
  passwordHistory (integer, required) — The count of previous passwords that are not allowed to be reused, starting with the most recent.
  specialChars (integer, required) — The minimum number of special characters required in the password string.
  uppercase (integer, required) — The minimum number of uppercase characters required in the password string.

PasswordPolicyUpdateRequest
Properties:
  passwordPolicies (PasswordPoliciesUpdateRequest, required)

PasswordPoliciesUpdateRequest
Properties:
  digits (integer) — The minimum number of numeric digits required in the password string.
  forceExpiredPasswordChange (integer) — The number of days the password is valid before a new password is required.
  length (integer) — The minimum number of characters allowed in the password.
  lowercase (integer) — The minimum number of uppercase characters required in the password string.
  maxLength (integer) — The maximum number of characters allowed in the password.
  passwordHistory (integer) — The minimum age of a password in days to allow its reuse.
  specialChars (integer) — The minimum number of special characters required in the password string.
  uppercase (integer) — The minimum number of uppercase characters required in the password string.