/ /

GitLab API reference

Updated 5 seconds ago

Overview

This article describes how the integration connects to GitLab through its REST API to fetch project data. It covers the base URL, a sample authenticated request, the API endpoints used, and the rate limits that apply to those calls.

Base URL

All API requests are made to the following base URL:

https://gitlab.com

Self-hosted GitLab instances use their own base URL (for example, https://gitlab.yourcompany.com).

Sample cURL request

The following request lists projects the authenticated user is a member of, returning up to 100 results per page.

curl --location 'https://gitlab.com/api/v4/projects?membership=true&per_page=100' \ --header 'PRIVATE-TOKEN: glpat-xxxxxxxxxxxxxxxxxx' \ --header 'Cookie: _cfuvid=.po9WoGqMtlPiLtQbGNxX..xy6mMLraxQ5UckLvA8WY-1779039860.6197002-1.0.1.1-qHfjJbifwQEDtFS_c7e1ZTItF1pNPmXqAG2FxfO1H_k'

GitLab APIs used

Object Type

API Endpoint

Merge Requests

/api/v4/projects/:id/merge_requests

Merge Request Comments

/api/v4/projects/:id/merge_requests/:merge_request_iid/notes

Issues

/api/v4/projects/:id/issues

Commits

/api/v4/projects/:id/repository/commits

Repository Tree

/api/v4/projects/:id/repository/tree

Raw File Content

/api/v4/projects/:id/repository/files/:file_path/raw

Wikis

/api/v4/projects/:id/wikis

Wiki Page Content

/api/v4/projects/:id/wikis/:slug

API rate limiting

GitLab APIs enforce rate limits to prevent abuse and ensure platform stability.

Official rate limits

The following limits are enforced by GitLab:

Limit Type

Threshold

Time Window

HTTP Status on Exceed

Authenticated requests

2,000

1 minute

429 Too Many Requests

Unauthenticated requests

10

1 minute

429 Too Many Requests

Note: Self-hosted GitLab instances may have different rate limits configured by administrators.

Scope

Rate limits are applied per user for authenticated requests. All API calls using the same API token contribute to the same rate limit bucket.

Was this article helpful?
Subscribe to receive updates on this article