doc/api/openapi/_index.md
GitLab documents its REST API using the OpenAPI 3.0 specification (formerly called Swagger), a standard, platform-independent format for describing RESTful APIs. The API code is the single source of truth for the REST API. The OpenAPI spec is autogenerated directly from the API code and is tightly coupled to its implementation, ensuring the documentation is always accurate and up to date.
For general information about the GitLab APIs, see Extend with GitLab.
The raw OpenAPI 3.0 specification is available in the GitLab monorepo:
doc/api/openapi/openapi_v3.yaml[!note] The OpenAPI 2.0 specification (
openapi_v2.yaml) is deprecated and no longer receives updates. Use the OpenAPI 3.0 specification (openapi_v3.yaml) instead.
The REST API is documented in full using the OpenAPI 3.0 specification. You can browse and test every endpoint interactively in the REST API documentation.
The documentation is rendered using Scalar, an open-source API reference tool. It is generated automatically from the OpenAPI spec in the GitLab source code, so it always reflects the current state of the API.
Some endpoints require authentication. GitLab supports authentication with HTTP Bearer or OAuth 2.0 credentials.
To add authorization credentials:
http, enter your personal access token.oauth2, use the authorization code flow with GitLab as the identity provider.Your credentials are reused automatically for all subsequent requests during the session.
Use the interactive request tool to send live requests to GitLab.
To send a live request:
The tool displays the curl command, the full request URL, and the server response.