Hi everyone,
I’m encountering an unexpected behavior while using the Okta User API for pagination. Here’s the scenario:
{{url}}/api/v1/users?after=&sortBy=profile.firstName&limit=20&search=profile.firstName eq “XYZ”
- I’ve set the limit parameter to 20 and sorted the results by
profile.firstName
. - When exactly 20 users are matching the query, Okta still returns the next link (
rel=next
) in the response.
According to my understanding, the next link should only be provided if there are more than 20 users, but in this case, it seems to be present even when there are no additional records beyond the 20.
Is this the intended behavior of the Okta User API, or could it possibly be a bug? I’ve reviewed the documentation but couldn’t find any specific mention of this behavior.
If anyone has encountered a similar issue or has insights into how I can address it, I would greatly appreciate your help.
It works when I remove sortBy or Search from the query.
Thanks in advance!