I have many project in my Gitlab and I want to add a group to all of my project.
I'm looking for a curl command to invite a group to my Gitlab project.
for example maintainer privileges
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.com/api/v4/groups/:id/projects/:project_id"
Please refer Gitlab docs for more details
the following actually worked for me
curl -X POST --header "PRIVATE-TOKEN: xxxxxxxxxxxx" --header "Content-Type: application/json" "https://gitlab.com/api/v4/projects/<<project_id>>/share" --data '{"group_id":<<group_id>>,"group_access":<<access to given to group>>}'
where group_id is the group id of the group which you want to add as a member of the project