<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
System Status
Announcements
Announcements
Search
Search
Select Language

Listing Suspended Okta Users via API

Lifecycle Management
Okta Classic Engine
Okta Identity Engine

Overview

The Okta Users API supports filtering users by status using the filter query parameter, enabling retrieval of a list of users with a SUSPENDED status via a cURL command or Postman. Configuring the filter parameter to status eq "SUSPENDED" and sending the request resolves the issue of identifying suspended users programmatically.

 

NOTE: Some cURL code examples include SSWS API token authentication. However, Okta recommends using scoped OAuth 2.0 and OpenID Connect (OIDC) access tokens to authenticate with Okta management APIs. OAuth 2.0 and OIDC access tokens provide fine-grained control over the bearer's actions on specific endpoints. See Okta API authentication methods.

 

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Universal Directory
  • Okta API
  • Postman

Solution

Retrieving Suspended Users Using a cURL Command

Use the following cURL command to send a GET request to the Okta Users API with the filter query parameter set to return only suspended users.

curl -X GET \ 'https://{OktaDomainName}/api/v1/users?filter=status eq "SUSPENDED"' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: SSWS {APIkey}'
  • Replace {OktaDomainName} with the Okta domain and {APIkey} with the Okta API token.
  • The filter parameter retrieves a filtered list of users with a SUSPENDED status.
  • The response returns a JSON-formatted list of suspended users, which can be converted to CSV.

 

How are suspended users retrieved using Postman?

Complete the following prerequisites, then follow the steps to retrieve suspended users in Postman as detailed in either the video demonstration or the written instructions.

 

 

Prerequisites:

Configure the List Users with a filter request and retrieve the suspended users list:

  1. Set up the Postman app as described in the Test the Okta REST APIs using Postman article.
  2. Import the Okta Users collection found on the Okta Users API collection Okta developer page.
  3. Prepare the List Users with a filter API call.
  4. On the Params page, change the filter parameter to status eq "SUSPENDED". If the results exceed 25 users, uncheck the limit parameter and select Send.
  5. Save the response to a file and convert it to CSV.

Postmant response

 

Loading
Listing Suspended Okta Users via API | Okta Support