Add reposetory to group project

Hello,

I am trying to add a repo to a groep project.
I tried it using the method in:

curl -H “Private-Token: %token%” -X POST https://gitlab.com/api/v4/projects?path=testproject.nl&namespace_id=2507989

But then it still adds it to my user.
Could someone point me in the right direction?

Hello,

using the POST method you can not send parameters through the url.

Try this:

curl -H "Private-Token: %token%" -X POST -H "Content-Type: application/json" -d '{"path":"test","namespace_id":"2507989"}' https://gitlab.com/api/v4/projects

or

curl -H “Private-Token: %token%” -X POST -H “Content-Type: application/json” -d @./data.json https://gitlab.com/api/v4/projects

1 Like

Thats it! thanks.

i guess i was usting the v3 way to post to a v4 api.