Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all users in a Gitlab repo?

Tags:

curl

gitlab-ce

We host our own Gitlab-CE repo. How can I get a list of all the users? I do..

$ curl -H "Project-Token: dkjdlkfjlfj" https://gitlab.domain.com/api/v3/users

but because of pagination, I can only get 20 of the them, which is the default. How can I get all the users?

like image 341
Chris F Avatar asked Jan 20 '26 03:01

Chris F


1 Answers

You cannot disable pagination completely for the GitLab API.

However, you can increase the max number of returned results from 20 to 100 via the per_page URL parameter:

$ curl -H "Project-Token: dkjdlkfjlfj" https://gitlab.domain.com/api/v3/users?per_page=100

After that, it's a matter of firing off multiple requests to get all users.

like image 122
TimoStaudinger Avatar answered Jan 22 '26 20:01

TimoStaudinger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!