0

I want to retrieve all members in a project irrespective of their role.

According to this documentation (https://docs.gitlab.com/ee/api/members.html)

If i use this API : GET /projects/:id/members

I can only get the members that are created by the user whose personal access token i pass in the API request. But i want to retrieve all the members in a project irrespective of their role and who created it.

1 Answers1

1

I think below should work for you.

GET /api/v4/projects/:id/members/all

This will list all members of the project. I can verify the difference between output compared with below API which returns limited users (created by the authenticated user)

GET api/v4/projects/:id/members
Sanjay Bharwani
  • 3,317
  • 34
  • 31
  • I even tried using this API. It returns the members created by the authenticated user and some other list of members who is not in the members list of the project (which is not required) but not returns the members created by other users. – Nikil Lepcha Jun 15 '22 at 09:38
  • Okay, I see the results and not all users are created by me. But yes I see some other members too. May be inherited from the Parent Group. – Sanjay Bharwani Jun 16 '22 at 08:23