Skip to content

Update password

Request

CORS
OAuth 2.0 scope:
  • okta.users.manage

Updates a user's password by validating the user's current password.

This operation provides an option to delete all the sessions of the specified user. However, if the request is made in the context of a session owned by the specified user, that session isn't cleared.

You can only perform this operation on users in STAGED, ACTIVE, PASSWORD_EXPIRED, or RECOVERY status that have a valid password credential.

The user transitions to ACTIVE status when successfully invoked in RECOVERY status.

Note: The Okta account management policy doesn't support the /users/{userId}/credentials/change_password endpoint. See Configure an Okta account management policy.

Path
userIdstringrequired

ID of an existing Okta user

Example:00ub0oNGTSWTBKOLGLNR
Query
strictboolean

If true, validates against the password minimum age policy

Default:false
Bodyapplication/jsonrequired
newPasswordobject(PasswordCredential)

Specifies a password for a user.

When a user has a valid password, imported hashed password, or password hook, and a response object contains a password credential, then the password object is a bare object without the value property defined (for example, password: {}). This indicates that a password value exists. You can modify password policy requirements in the Admin Console by editing the Password authenticator: Security > Authenticators > Password (or for Okta Classic orgs, use Security > Authentication > Password).

For information on defaults and configuring your password policies, see Configure the password authenticator in the help documentation.

oldPasswordobject(PasswordCredential)

Specifies a password for a user.

When a user has a valid password, imported hashed password, or password hook, and a response object contains a password credential, then the password object is a bare object without the value property defined (for example, password: {}). This indicates that a password value exists. You can modify password policy requirements in the Admin Console by editing the Password authenticator: Security > Authenticators > Password (or for Okta Classic orgs, use Security > Authentication > Password).

For information on defaults and configuring your password policies, see Configure the password authenticator in the help documentation.

revokeSessionsboolean

When set to true, revokes all user sessions, except for the current session

Default:false
curl -i -X POST \
  'https://subdomain.okta.com/api/v1/users/00ub0oNGTSWTBKOLGLNR/credentials/change_password?strict=false' \
  -H 'Content-Type: application/json' \
  -d '{
    "oldPassword": {
      "value": "tlpWENT2m"
    },
    "newPassword": {
      "value": "uTVM,TPw55"
    },
    "revokeSessions": true
  }'

Responses

Success

Bodyapplication/json
passwordobject(PasswordCredential)

Specifies a password for a user.

When a user has a valid password, imported hashed password, or password hook, and a response object contains a password credential, then the password object is a bare object without the value property defined (for example, password: {}). This indicates that a password value exists. You can modify password policy requirements in the Admin Console by editing the Password authenticator: Security > Authenticators > Password (or for Okta Classic orgs, use Security > Authentication > Password).

For information on defaults and configuring your password policies, see Configure the password authenticator in the help documentation.

providerobject(AuthenticationProvider)read-only

Specifies the authentication provider that validates the user's password credential. The user's current provider is managed by the Delegated Authentication settings for your org. The provider object is read-only.

recovery_questionobject(RecoveryQuestionCredential)

Specifies a secret question and answer that's validated (case insensitive) when a user forgets their password or unlocks their account. The answer property is write-only.

Response
{ "password": {}, "recovery_question": { "question": "Who's a major player in the cowboy scene?" }, "provider": { "type": "OKTA", "name": "OKTA" } }