<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
How to Set an Okta Recovery Question for Users in Bulk Using Postman
Administration
Okta Classic Engine
Okta Identity Engine
Overview

To perform a bulk update of Okta recovery questions for multiple users simultaneously, export a user list and execute a collection run using Postman and the Okta Application Programming Interface (API).

Applies To
  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Application Programming Interface (API)
  • Postman
  • User Administration
  • User Accounts Report
Solution

How is a recovery question set for users in bulk using Postman?

To update the recovery questions for multiple users, export a CSV file of the target users from the Admin Console, format the file, and execute a PUT request collection in Postman using the Okta API.

NOTE: Okta recommends using scoped OAuth 2.0 and OpenID Connect (OIDC) access tokens to authenticate with Okta management APIs. OAuth 2.0 and OIDC access tokens provide fine-grain control over the bearer's actions on specific endpoints. Whenever possible, Okta recommends using OAuth 2.0 and OIDC access tokens as detailed in How to Integrate Postman with Okta and Implement OAuth for Okta.

 

  1. Generate a CSV file containing the userId values that require updates.
    1. In the Okta Admin Console, navigate to Reports > Reports > select User Accounts.
    2. Click Edit Filters to filter the report.
    3. Select the desired filters to apply, or leave the filters blank to show all users.
    4. Click Apply.
    5. Click CSV Export.
  2. Edit the exported CSV file to retain only the user ID column, deleting any extra columns, and change the header of the user.Id column to userId.

UserID Example

  1. Create the following call inside Postman:
    PUT {{url}}/api/v1/users/{{userId}}
 
 
  • Headers:
    • Key: Content-Type Value: application/json
    • Key: Accept Value: application/json

 

  • Body:
    NOTE: The body payload determines the security question and answer for all the users.
    {
      "credentials": {
        "recovery_question": {
          "question": "What is your favourite pet?",
          "answer": "cat"
        }
      }
    }

Body

  1. Create a new collection in Postman and add the call to it.
  2. Navigate to the collection and click Run Collection.

Postman1  Postman2 

  1. Open the Postman Runner and select the collection, environment, and iterations. Add a delay between calls to avoid hitting the API Rate Limit.
  2. Run the call in the Postman Runner.

Related References

Loading
How to Set an Okta Recovery Question for Users in Bulk Using Postman