Users API: Next Link Response Header sent even when no further records are to be displayed

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!

Hello @KBob,

I’ve been able to reproduce the same behavior myself when matching the number of results to the limit exactly, so I am thinking we need to further investigate this on our end. To that end, I will DM you to see if we can coordinate getting this investigated with our Support and Engineering teams here at Okta.

1 Like

@daniel.sanders Any updates on this bug?