'How do I remove unwanted users from OKTA Developer?
I'm using the OKTA Developer package.
I imported 100 users out of 800 plus, but the user I wanted to add was not among the 100.
I would like to start over.
So how do I remove the 100 users that I already imported?
Solution 1:[1]
Using Okta API you can easily do this operation.it will provide many operations as per your requirement. you can Activate, Deactivate, Suspend, Unsuspend, Delete users using the API calls below is the link which you can refer to.
Try to run this into postman you will get a better idea of functionality. https://developer.okta.com/docs/reference/api/users/#lifecycle-operations
If you assigned users In any group then you can also delete the group refers to the given link. https://developer.okta.com/docs/reference/api/groups/#remove-group
Solution 2:[2]
You can't actually delete user records in Okta. This is by design (for auditing reasons) but it's a pain in your situation. However, you can de-provision users so that don't show up in the system.
The easiest way to do so may be to call the '/users' API resource and iterate through the user IDs.
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: SSWS {{apikey}}" \
-H "Cache-Control: no-cache" \
-d '' https://{{url}}/api/v1/users/{{userId}}/lifecycle/deactivate
Solution 3:[3]
Once you deactivate the user, you can delete them permanently by running the following CURL script:
curl -v -X DELETE \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS {{apikey}}" \
"https://{{URL}}/api/v1/users/{{USERID}}"
Solution 4:[4]
Here is the official way to delete users from the okta
https://github.com/OktaSupport/delete-users-ps-script
You just have to run a shell script by a command:
.\delete-users.ps1 –orgurl "https://EXAMPLE.okta.com" -apikey “YourApiToken” -filepath “user-list.csv"
user-list.csv have to contain all usernames which you want to delete.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ira |
| Solution 2 | Benjamin Wesson |
| Solution 3 | Ryan D |
| Solution 4 | CREZi |
