Search code examples
gitlabgitlab-api

How to get specific user project that has membership any project on gitlab?


I want to get an user's projects that included as member any project. For example i am included 10 projects in my company but i have no personel project.

https://MyDomain/api/v4/users/USER_ID/projects returns only personel projects.

I need smth like https://MyDomainapi/v4/users/USER_ID/MemberedProjects.

Otherwise i have to iterate inside projects members until i got all the membershipped(included) projects for a specific user.


Solution

  • You are using List user projects which returns only user's personal projects.

    You can use the following to get all projects where your user is a member of (this include the user's personnal projects):

    https://<your_domain>/api/v4/projects?membership=true