List All Deactivated Okta Users Using the API
Last Updated:
Overview
Retrieve a list of deactivated Okta users by executing a GET request to the Okta Users API with a filter query parameter. Use an API client like Postman or a cURL command to filter the user status to deprovisioned.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Universal Directory
- Okta API
- Postman
Solution
NOTE: Okta recommends using scoped OAuth 2.0 and OIDC access tokens to authenticate with Okta management APIs instead of SSWS API tokens. OAuth 2.0 and OIDC access tokens provide fine-grain control over the actions on specific endpoints. See Okta API authentication methods for more information.
NOTE: Postman is a third-party tool, and Okta is not responsible for any changes to the application. Okta Support cannot troubleshoot issues with the application itself.
How are deactivated users listed using a cURL command?
Execute a GET request to the Okta Users API using a cURL command with the filter parameter set to retrieve users with a deprovisioned status.
curl -X GET \
'https://<OktaDomainName>/api/v1/users?filter=status eq "DEPROVISIONED"' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: SSWS <theAPIkey>'
Replace <OktaDomainName> with the Okta domain and <theAPIkey> with the Okta API token. The response contains a JSON-formatted list of deactivated users, which converts into a CSV file.
List deactivated users using Postman.
Fulfill the prerequisites by configuring Postman, importing the Okta Users API collection, and executing the list users API call with the deprovisioned status filter.
- Configure Postman for the organization environment as described in the Test the Okta REST APIs using Postman article.
- Import the Okta Users Collection found on the Okta Users API collection page.
- Prepare the List Users with a filter API call.
- On the Params page, change the filter parameter to
status eq "DEPROVISIONED". - Uncheck the limit parameter if the results surpass 25 users and click Send.
- Save the response to a file and convert it to a CSV format.
