<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

Bulk Create Okta Groups Using the Postman API

Lifecycle Management
Okta Classic Engine
Okta Identity Engine

Overview

Administrators can bulk-create groups in Okta by using a Postman runner and leveraging the Okta Groups API. Configure the Postman environment with the Okta API collections and execute a runner with a formatted Comma-Separated Values (CSV) file to automate group creation.

 

NOTE: These scripts should be used at one's own risk. All scripts are provided as is without warranty of any kind. Okta disclaims all implied warranties, including, without limitation, any implied warranties of fitness for a particular purpose. It is strongly recommended to test the Runner with a small batch of groups before running the call for all users/groups.

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Application Programming Interface (API)
  • Okta Groups API
  • Postman

Solution

What are the prerequisites for bulk creating Okta groups?

Verify the following prerequisites before attempting to bulk create groups using the Okta Groups API.

 

How is the Postman environment configured for bulk group creation?

Configure the Postman application and prepare the API call body with variables that match the CSV file headers, as detailed in either the video demonstration or the written instructions.

 

 

  1. Set up the Postman application as described in the Test the Okta REST APIs using Postman article.
  2. Prepare the CSV file with the name and description headers.
  3. Change the body for the Add Group API call by replacing the constants in the profile name and description with variables, and select Save.
    Postman
  4. Verify that the variable names of the executed calls match the headers of the table in the created CSV file.

 

How is the Postman runner executed?

Execute the Postman runner by selecting the required collection and CSV file to process the API calls.

  1. Select Runner on the bottom right of the Postman application page.
    Postman
  2. Drag the required collection containing the necessary call to the middle of the workspace.
    Postman
  3. Select the CSV file.
    Postman
  4. Select Run Collection_Name.
    Postman
  5. Verify the runner starts processing the CSV file and returns the results of each call, which returns a 200 status code if successful.
    Postman

 

What are common issues encountered when running the Postman collection?

Review the following common errors and their resolutions when executing the Postman runner.

  • If the runner returns a 400 Bad Request response on each iteration, verify if the endpoint supports the method (GET, PUT, PATCH, POST) used on the call by checking the actual API call executed on the runner and changing the status according to the API reference for public endpoints.
  • If the runner returns a 404 Not Found response on each iteration, check the CSV file to ensure the headers match the variables defined on the API call as per the CSV formatting guide found in the Using CSV and JSON Data Files in the Postman Collection Runner article.

 

Related References

Loading
Bulk Create Okta Groups Using the Postman API | Okta Support