<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Change the Okta Recovery Question Using API

Okta Classic Engine
All Engines
Okta Identity Engine
API Access Management
Administration

Overview

This article explains how a Super Admin, Org Admin, or Help Desk Admin can update a user's recovery question using the API. This operation updates the recovery question used for password resets via the Update User endpoint.

 

NOTE: This operation can only be performed on users with valid credentials in Staged, Active, or Recovery status.

Applies To

  • Recovery Question
  • Okta Application Programming Interface (API0
  • Okta Classic Engine
  • Okta Identity Engine (OIE)

Solution

Prepare a PUT request to the following endpoint:

/api/v1/users/<user_id>/credentials/change_recovery_question

NOTE: This endpoint changes the Recovery Question used to reset a forgotten password. If the intent is to change the Security Question used for Multi-Factor Authentication (MFA) prompts during login, use the /api/v1/users/<user_id>/factors endpoint instead.

  1. Construct the JavaScript Object Notation (JSON) body by wrapping the question and answer inside a credentials object:

    {
        "password": {
          "value": "tlpWENT2m"
        },
        "recovery_question": {
          "question": "How many roads must a man walk down?",
          "answer": "forty two"
        }
     }

  1. Execute the request:

    curl -i -X POST \
      'https://{youroktadomain}/api/v1/users/00ub0oNGTSWTBKOLGLNR/credentials/change_recovery_question' \
      -H 'Content-Type: application/json' \
      -d '{
        "password": {
          "value": "tlpWENT2m"
        },
        "recovery_question": {
          "question": "How many roads must a man walk down?",
          "answer": "forty two"
        }
      }'

     


Related References

Loading
Change the Okta Recovery Question Using API | Okta Support