# Api list of all users pageSize limit is 500

**URL:** <https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657>\
**Category:** SonarQube Server / Community Build\
**Tags:** web\_api\
**Created:** [August 5, 2021, 6:18pm UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657 "2021-08-05T18:18:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fword3](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fword3/32/32373_2.png) [@fword3](https://community.sonarsource.com/u/fword3)\
**Post date:** [August 5, 2021, 6:18pm UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657/1 "2021-08-05T18:18:01Z")

</div>

Enterprise Edition - Version 7.9.3

How can I pull a list of all our users (just names). Ran into pageSize limit of 500. Also, can the output be in a different format as well?

Here is what I’m currently using:  
`curl -u <token>: https://<website>/api/users/search?pageSize=500`

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 5, 2021, 7:08pm UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657/2 "2021-08-05T19:08:45Z")

</div>

Hi,

Welcome to the community!

First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

> 7.9.3 → 8.9.2 → 9.0.1 (last step optional)

Regarding your actual question, you should be able to pull multiple pages using the `p` parameter, IIRC. Output format is not modifiable server-side. You’ll need to read it in and output the data in your format of choice.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![fword3](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fword3/32/32373_2.png) [@fword3](https://community.sonarsource.com/u/fword3)\
**Post date:** [August 6, 2021, 12:36am UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657/3 "2021-08-06T00:36:51Z")

</div>

Hi Ann,  
Thanks for replying.

Alright, call me slow but I’m just not following here. When I set the **ps=50** and the **p=2** I should get **100** users back right? However, I’m only getting **50**. Also, when it says **total 1694** could I assume this is my total number of users? This does correlate with the count from the UI. Still need the list of all users though.

Here is my curl command:

```auto
curl -u <token>: 'https://localhost/api/users/search?ps=50&p=2' 

```

and here is the start of my json file:

```auto
{"paging":{"pageIndex":2,"pageSize":50,"total":1694},"users":

```

What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![Tobias\_Trabelsi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tobias_trabelsi/32/31755_2.png) [@Tobias\_Trabelsi](https://community.sonarsource.com/u/Tobias_Trabelsi)\
**Post date:** [August 6, 2021, 5:54am UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657/4 "2021-08-06T05:54:54Z")

</div>

Hi @fword3 ,

you need to iterate over the pages. think of it like a book where you can define the number of sentences per page. if you define a page size (ps) of 50, you will get 50 entries on one page in return. with this information you can now iterate over the pages. `ps=50&p=2` would give you now 50 entries on the second page and so on.

in order to get all users in your instance you could write something like this:

```bash
#!/bin/bash

#4*500>1694

TOKEN="your token"

for i in 1 2 3 4;
do
	curl -u "${TOKEN}:" "http://localhost:9000/api/users/search?ps=500&p=$i"
done

```

hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![fword3](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fword3/32/32373_2.png) [@fword3](https://community.sonarsource.com/u/fword3)\
**Post date:** [August 6, 2021, 11:35am UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657/5 "2021-08-06T11:35:24Z")

</div>

Now there you go Tobias, that’s what I’m talking about and you even provide code. 👏

Cheers!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [August 13, 2021, 11:35am UTC](https://community.sonarsource.com/t/api-list-of-all-users-pagesize-limit-is-500/47657/6 "2021-08-13T11:35:48Z")

</div>

Closed on August 13, 2021, 11:35am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
