The correct base url for the hosted GitLab is https://gitlab.com/api/v4/ so your request to
GET /projects would be

curl --header "PRIVATE-TOKEN: XXXXXX" "https://gitlab.com/api/v4/projects"

That would return all projects that are visible to you, including other user's public projects.

If you wish to view just your projects, then you should use the GET /users/:user_id/projects endpoint, where :user_id is your user ID that can be found on your GitLab profile page or in the response to your request to GET /user if you're authenticated.

# Get :user_id from this request
curl --header "PRIVATE-TOKEN: XXXXXX" "https://gitlab.com/api/v4/user"

# See your projects by replacing :user_id with id value from previous request
curl --header "PRIVATE-TOKEN: XXXXXX" "https://gitlab.com/api/v4/users/:user_id/projects"

Also, the project ID is not the same as the project name. You can retrieve the project ID from the response of your request to GET /users/:user_id/projects, or from the project's settings page.

Answer from BrokenBinary on Stack Overflow
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects
Projects API | GitLab Docs
dap_powered value for reviewer_assignment_strategy removed in GitLab 19.4. Retrieves the specified project. This endpoint can be accessed without authentication if the project is publicly accessible. ... curl --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Accept: application/json" \ --url "https://gitlab.example.com/api/v4/projects/<project_id>"
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api
REST API | GitLab Docs
Some REST API requests have specific requirements, including the data format and encoding used. API requests can use parameters sent as query strings or as a payload body. GET requests usually send a query string, while PUT or POST requests usually send the payload body: ... curl --request POST \ --url "https://gitlab.example.com/api/v4/projects?name=<example-name>&description=<example-description>"
Discussions

Can't find out base GitLab API base url - Stack Overflow
Copy# Get :user_id from this request ...itlab.com/api/v4/users/:user_id/projects" Also, the project ID is not the same as the project name. You can retrieve the project ID from the response of your request to GET /users/:user_id/projects, or from the project's settings page. ... Is there any snippet that would translate human-seen gitlab url to api url ... More on stackoverflow.com
🌐 stackoverflow.com
Where do I find the project ID for the GitLab API? - Stack Overflow
As mentioned here, all the project scoped APIs expect either an ID or the project path (URL encoded). So just use https://gitlab.com/api/v4/projects/gitlab-org/gitlab-foss directly when you want to interact with a project. More on stackoverflow.com
🌐 stackoverflow.com
How to get the project details using Gitlab API
Currently i have the below url for my gitlab and i would like to fetch all the projects details of MRs which are open. I know if we provide the project id in the url i could fetch. But it involves lot of manual task to g… More on forum.gitlab.com
🌐 forum.gitlab.com
1
0
February 15, 2024
GitLab API - What is URL encoded and how do I find the :filepath?
:filepath is the place where you'd substitute the path to the file in the repository. Url encoded means that character with special meaning in http are translated into versions that can be safely sent without altering the meaning of the request. In the example, encoded string "lib%2Fclass%2Erb" would decode to "lib/class.rb". There are a number of characters that can't be sent normally, and they all have "url encoded" versions. More on reddit.com
🌐 r/learnprogramming
7
0
December 3, 2018
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources
REST API resources | GitLab Docs
The GitLab REST API gives you programmatic control over GitLab resources. Build integrations with your existing tools, automate repetitive tasks, and extract data for custom reports. Access and manipulate projects, groups, issues, and merge requests without using the web interface.
🌐
Python GitLab
python-gitlab.readthedocs.io › en › stable › api-usage.html
Using the REST API - python-gitlab v8.5.0
Note that a url that results in 301/302 redirects will raise an error, so it is highly recommended to use the final destination in the url field. For example, if the GitLab server you are using redirects requests from http to https, make sure to use the https:// protocol in the URL definition.
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-access-the-gitlab-api
How To Access The GitLab API? - GeeksforGeeks
July 23, 2025 - ... import requests # Replace with your GitLab URL and token gitlab_url = "https://gitlab.com/api/v4/projects" headers = { "PRIVATE-TOKEN": "<your_personal_access_token>" } response = requests.get(gitlab_url, headers=headers) if response.status_code ...
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › repositories
Repositories API | GitLab Docs
Plain text format (.txt) introduced in GitLab 19.1. Generate changelog data based on commits in a repository, without committing them to a changelog file. Works exactly like POST /projects/:id/repository/changelog, except the changelog data is not committed to any changelog file. ... Optional.
Find elsewhere
🌐
Rewind
rewind.com › home › blog › backup blogs
Using the GitLab API | Rewind
September 3, 2024 - For example, the `/projects/:id` endpoint does not require authentication. However, the GitLab API provides several methods for authenticating users before allowing access to certain high-level actions. Some of the authentication methods include: OAuth2 tokens can be employed as a way to authenticate users via the GitLab API. The token can be passed as an `access_token` parameter to the base URL or as an Authorization header.
🌐
University of Toronto
microfluidics.utoronto.ca › help › help
Projects · Api · Help · GitLab
container_registry_size: Total storage size in bytes used by all container repositories in the project. Updated whenever container images are pushed or deleted. For GitLab Self-Managed instances, requires the container registry metadata database to be enabled. ... { "id": 3, "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>", "default_branch": "main", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git
🌐
Medium
medium.com › devops-with-valentine › how-to-use-the-gitlab-rest-api-ba4e4ca1fcae
How to use the GitLab REST API. The GitLab API allows you to perform… | by Valentin Despa | DevOps with Valentine | Medium
September 24, 2021 - For people just getting started with APIs, the REST API is much easier to understand and use. So this is what I will be demoing in this tutorial. The GitLab API specification defines various endpoints based on the action we want to perform. Let’s do a simple request using Postman. I am using gitlab.com, so the GitLab API base URL will be this: ... I will call the projects endpoint to get a list of all public projects.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › releases
Project release API | GitLab Docs
Creates an evidence for an existing release. ... curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/evidence" ... Updates a release. Developer level access to the project is required to update a release. ... curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \ --header 'Content-Type: application/json' \ --data '{"name": "new name", "milestones": ["v1.2"]}' \ --url "https://gitlab.example.com/api/v4/projects/24/releases/v0.1"
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › import and export
Project import and export API | GitLab Docs
Retrieves the status of the most recent import for a specified project. ... curl --request GET \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/1/import"
🌐
GitLab
forum.gitlab.com › how to use gitlab
How to get the project details using Gitlab API - How to Use GitLab - GitLab Forum
February 15, 2024 - Currently i have the below url for my gitlab and i would like to fetch all the projects details of MRs which are open. I know if we provide the project id in the url i could fetch. But it involves lot of manual task to g…
🌐
Python GitLab
python-gitlab.readthedocs.io › en › v4.12.1 › api-usage.html
Using the REST API - python-gitlab v4.12.1
Note that a url that results in 301/302 redirects will raise an error, so it is highly recommended to use the final destination in the url field. For example, if the GitLab server you are using redirects requests from http to https, make sure to use the https:// protocol in the URL definition.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › pipelines
Pipelines API | GitLab Docs
This endpoint returns a success response 200 regardless of the pipeline’s state. For more information, see issue 414963. curl --request POST \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/1/pipelines/46/cancel"
🌐
GitLab
bioinfotiget.it › help
Index · Api · Help · GitLab
If a file path, branch or tag contains a /, make sure it is URL-encoded. ... GET /api/v4/projects/1/repository/files/src/README.md?ref=master GET /api/v4/projects/1/branches/my/branch/commits GET /api/v4/projects/1/repository/tags/my/tag · API Requests can use parameters sent as query strings or as a payload body. GET requests usually send a query string, while PUT or POST requests usually send the payload body: ... curl --request POST "https://gitlab/api/v4/projects?name=<example-name>&description=<example-description>"
🌐
Packtpub
subscription.packtpub.com › book › cloud-and-networking › 9781783986842 › 6 › ch06lvl1sec53 › managing-your-projects-via-the-api
6. Webhooks, External Services, and the API | Gitlab Cookbook
Let's start by retrieving all the projects we currently have in our GitLab server. Open the Postman app and enter your GitLab URL followed by /api/v3/projects?secret_token=YOUR_TOKEN.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › authentication
REST API authentication | GitLab Docs
See OAuth 2.0 token documentation for how to request a new access token using a refresh token. You can use access tokens to authenticate with the API. Pass the token using the PRIVATE-TOKEN header (recommended) or other methods. ... curl --request GET \ --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects"
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › members
Projects members API | GitLab Docs
If administrator approval for role promotions is turned on, membership requests that promote existing users into a billable role require administrator approval. To enable Manage Non-Billable Promotions, you must first enable the enable_member_promotion_management application setting. ... curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ --data "user_id=1&access_level=30" \ --url "https://gitlab.example.com/api/v4/projects/:id/members"