API: bug in users/search endpoint

  • SonarQube - Developer Edition Version 9.0 (build 45539)

When requesting the users via the web_api through the endpoint GET api/users/search only 49 users are returned, as displayed on the web gui by default. In the gui there is a button to “show more”.

On the API side, I would expect the web API to return all users instead of only the first 49. Is it possible to fix this issue?

It’s paginated, from the response example of web api doc for api/users/search

{
“paging”: {
“pageIndex”: 1,
“pageSize”: 50,
“total”: 2
},
“users”: [
{
…

You may use ps=500 (pagesize 500 is max) instead of default pagesize 50.
If that is not enough you need to get total pagecount and use a loop, similar to that example

Great, thanks for the fast answer!