API Access to Hosted Private Repository

What format should the URLs be in to access a hosted private repository through the API? I’ve tried messing round with various formats, and none of them seem to work.

Or maybe I’m asking the wrong question. Maybe it’s “how do you find the project id for a private project?” because it’s not in the overall project list.

I was wondering the same thing. I worked it out eventually. Go to your project page -> Settings -> General project settings, and there you can find the project ID. So an API request on the command prompt might look something like:

curl --request DELETE --header "PRIVATE-TOKEN:XXXXXXXXXXXX" https://gitlab.com/api/v4/projects/3899864/merge_requests/8