Skip to content

Reset password with recovery question

Request

CORS
OAuth 2.0 scope:
  • okta.users.manage

Resets the user's password to the specified password if the provided answer to the recovery question is correct. You must include the recovery question answer with the submission.

Path
userIdstringrequired

ID of an existing Okta user

Example:00ub0oNGTSWTBKOLGLNR
Query
sendEmailboolean
Default:true
Bodyapplication/jsonrequired
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.

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.

curl -i -X POST \
  'https://subdomain.okta.com/api/v1/users/00ub0oNGTSWTBKOLGLNR/credentials/forgot_password_recovery_question?sendEmail=true' \
  -H 'Content-Type: application/json' \
  -d '{
    "password": {
      "value": "uTVM,TPw55"
    },
    "recovery_question": {
      "answer": "Annie Oakley"
    }
  }'

Responses

Credentials

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" } }