<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 Bulk Create Groups Using Postman API
Lifecycle Management
Okta Classic Engine
Okta Identity Engine
Overview

The best way to create bulk groups in Okta is to use a Postman runner and leverage the Okta Groups API.


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. We strongly recommend testing Runner with a small batch of groups before running the call for all users/groups.

Applies To
  • Postman
  • Postman Runner
  • Okta API
  • Okta Groups API
Solution

Prerequisites: 


Set up the Postman environment

  1. Set up the Postman app as described in the Test the Okta REST APIs using Postman article.

  2. Prepare the CSV with the name and description headers.

  3. Change the body for the Add Group API call by replacing the constants in the profile's name and description with variables as shown below and click Save:
    Postman 

  4. A check of the variable names of the calls that are being done to match with the headers of the table in the created CSV should be done at this point.

Set up the runner

  1. On the bottom right of the Postman app page, click on Runner.

Postman

  1. Drag the required collection that contains the call that will be used to the middle of the workspace.

Postman

  1. Select the CSV file.

Postman

  1. Click on Run Collection_Name.

Postman

  1. The runner will start processing the CSV and returning the results of each call, which will return 200 if successful.

Postman

 

Common Issues:

  • If receiving 400 Bad Request as a response on each iteration, check if the endpoint supports the method(GET, PUT, PATCH, POST) that is used on the call by verifying the actual API call that is done on the runner and changing the status accordingly according to API reference for public endpoints.

  • If receiving 404 Not Found as a response on each iteration, check the CSV file, and if the Headers of the CSV match the variables defined on the API call as per the CSV formatting guide found on the Using CSV and JSON Data Files in the Postman Collection Runner article.

Related References

 
Loading
How to Bulk Create Groups Using Postman API