When making API calls with the Okta Users API and a search query parameter, only ten users are returned in the results.
- For example, running an API call with
/api/v1/users?q=nathanonly returns ten users when more should be returned.
- Okta Users API
When the "q" search parameter is used, only ten users are returned by default. For more information, please check the Okta API documentation.
This issue can be resolved in one of two ways:
- Limit parameter
- Use the limit parameter with the search to return more than ten users (up to a maximum of 200).
- For example, this API call would be formatted similarly to the following:
/api/v1/users?q=nathan&limit=200
- For example, this API call would be formatted similarly to the following:
- Use the limit parameter with the search to return more than ten users (up to a maximum of 200).
- List Users with search
- The search parameter can be used instead of the limit parameter. This parameter supports pagination and can return up to 200 results per API call and more with pagination.
- For example, this API call would be formatted similarly to the following:
/api/v1/users?search=profile.firstName+eq+%22nathan%22
- For example, this API call would be formatted similarly to the following:
- The search parameter can be used instead of the limit parameter. This parameter supports pagination and can return up to 200 results per API call and more with pagination.
NOTE:
- If assistance with using pagination with Okta API calls is needed, please see How to Use Pagination when Making API Calls in Postman.
- "Nathan" was used as an example. Please replace it with any first name, depending on the use case.
