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.
- Postman
- Postman Runner
- Okta API
- Okta Groups API
Prerequisites:
- Postman is configured for the org environment as described in the Test the Okta REST APIs using Postman article.
- An Okta Org.
- Okta API collections are imported into Postman.
- A CSV file with the users/groups that should be modified.
Set up the Postman environment
-
Set up the Postman app as described in the Test the Okta REST APIs using Postman article.
-
Prepare the CSV with the name and description headers.
-
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:
-
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
-
On the bottom right of the Postman app page, click on Runner.
-
Drag the required collection that contains the call that will be used to the middle of the workspace.
-
Select the CSV file.
-
Click on Run Collection_Name.
-
The runner will start processing the CSV and returning the results of each call, which will return 200 if successful.
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
- Postman
- Test the Okta REST APIs using Postman
- Postman Collections
- Using CSV and JSON Data Files in the Postman Collection Runner
- Core Okta API
