Skip to content

Gitlab API

by gitlab.com

OAuthHTTPSDevelopment
Open documentation ↗

Overview

Automate GitLab interaction programmatically

Gitlab is a development API from gitlab.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 358 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Development
Base URL
https://gitlab.com/api
Version
v3
Endpoints
358
Spec updated
2021-06-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://gitlab.com/api/v3/application/settings" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://gitlab.com/api/v3/application/settings", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://gitlab.com/api/v3/application/settings",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/v3/application/settingsGet the current application settings
PUT/v3/application/settingsModify application settings
POST/v3/ci/lintValidation of .gitlab-ci.yml content
GET/v3/deploy_keysgetV3DeployKeys
GET/v3/dockerfilesGet the list of the available template
GET/v3/dockerfiles/{name}Get the text for a specific template present in local filesystem
GET/v3/gitignoresGet the list of the available template
GET/v3/gitignores/{name}Get the text for a specific template present in local filesystem
GET/v3/gitlab_ci_ymlsGet the list of the available template
GET/v3/gitlab_ci_ymls/{name}Get the text for a specific template present in local filesystem
GET/v3/groupsGet a groups list
POST/v3/groupsCreate a group. Available only for users who can create groups.
GET/v3/groups/ownedGet list of owned groups for authenticated user
GET/v3/groups/{id}Get a single group, with containing projects.
PUT/v3/groups/{id}Update a group. Available only for users who can administrate groups.
DELETE/v3/groups/{id}Remove a group.
GET/v3/groups/{id}/access_requestsGets a list of access requests for a group.
POST/v3/groups/{id}/access_requestsRequests access for the authenticated user to a group.
DELETE/v3/groups/{id}/access_requests/{user_id}Denies an access request for the given user.
PUT/v3/groups/{id}/access_requests/{user_id}/approveApproves an access request for the given user.
GET/v3/groups/{id}/issuesGet a list of group issues
GET/v3/groups/{id}/membersGets a list of group or project members viewable by the authenticated user.
POST/v3/groups/{id}/membersAdds a member to a group or project.
GET/v3/groups/{id}/members/{user_id}Gets a member of a group or project.
PUT/v3/groups/{id}/members/{user_id}Updates a member of a group or project.
DELETE/v3/groups/{id}/members/{user_id}Removes a user from a group or project.
GET/v3/groups/{id}/notification_settingsGet group level notification level settings, defaults to Global
PUT/v3/groups/{id}/notification_settingsUpdate group level notification level settings, defaults to Global
GET/v3/groups/{id}/projectsGet a list of projects in this group.
POST/v3/groups/{id}/projects/{project_id}Transfer a project to the group namespace. Available only for admin.
GET/v3/hooksGet the list of system hooks
POST/v3/hooksCreate a new system hook
GET/v3/hooks/{id}Test a hook
DELETE/v3/hooks/{id}Delete a hook
POST/v3/internal/allowedpostV3InternalAllowed
GET/v3/internal/broadcast_messagegetV3InternalBroadcastMessage
GET/v3/internal/checkgetV3InternalCheck
GET/v3/internal/discovergetV3InternalDiscover
POST/v3/internal/lfs_authenticatepostV3InternalLfsAuthenticate
GET/v3/internal/merge_request_urlsgetV3InternalMergeRequestUrls
POST/v3/internal/two_factor_recovery_codespostV3InternalTwoFactorRecoveryCodes
GET/v3/issuesGet currently authenticated user's issues
GET/v3/keys/{id}Get single ssh key by id. Only available to admin users
GET/v3/licensesGet the list of the available license template
GET/v3/licenses/{name}Get the text for a specific license
GET/v3/namespacesGet a namespaces list
GET/v3/notification_settingsGet global notification level settings and email, defaults to Participate
PUT/v3/notification_settingsUpdate global notification level settings and email, defaults to Participate
GET/v3/projectsGet a projects list for authenticated user
POST/v3/projectsCreate new project
GET/v3/projects/allGet all projects for admin user
POST/v3/projects/fork/{id}Fork new project for the current user or provided namespace.
GET/v3/projects/ownedGet an owned projects list for authenticated user
GET/v3/projects/search/{query}Search for projects the current user has access to
GET/v3/projects/starredGets starred project for the authenticated user
POST/v3/projects/user/{user_id}Create new project for a specified user. Only available to admin users.
GET/v3/projects/visibleGet a list of visible projects for authenticated user
GET/v3/projects/{id}Get a single project
PUT/v3/projects/{id}Update an existing project
DELETE/v3/projects/{id}Remove a project
POST/v3/projects/{id}/(ref/{ref}/)trigger/buildsTrigger a GitLab project build
GET/v3/projects/{id}/access_requestsGets a list of access requests for a project.
POST/v3/projects/{id}/access_requestsRequests access for the authenticated user to a project.
DELETE/v3/projects/{id}/access_requests/{user_id}Denies an access request for the given user.
PUT/v3/projects/{id}/access_requests/{user_id}/approveApproves an access request for the given user.
POST/v3/projects/{id}/archiveArchive a project
GET/v3/projects/{id}/boardsGet all project boards
GET/v3/projects/{id}/boards/{board_id}/listsGet the lists of a project board
POST/v3/projects/{id}/boards/{board_id}/listsCreate a new board list
GET/v3/projects/{id}/boards/{board_id}/lists/{list_id}Get a list of a project board
PUT/v3/projects/{id}/boards/{board_id}/lists/{list_id}Moves a board list to a new position
DELETE/v3/projects/{id}/boards/{board_id}/lists/{list_id}Delete a board list
GET/v3/projects/{id}/buildsGet a project builds
GET/v3/projects/{id}/builds/artifacts/{ref_name}/downloadDownload the artifacts file from build
GET/v3/projects/{id}/builds/{build_id}Get a specific build of a project
GET/v3/projects/{id}/builds/{build_id}/artifactsDownload the artifacts file from build
POST/v3/projects/{id}/builds/{build_id}/artifacts/keepKeep the artifacts to prevent them from being deleted
POST/v3/projects/{id}/builds/{build_id}/cancelCancel a specific build of a project
POST/v3/projects/{id}/builds/{build_id}/eraseErase build (remove artifacts and build trace)
POST/v3/projects/{id}/builds/{build_id}/playTrigger a manual build
POST/v3/projects/{id}/builds/{build_id}/retryRetry a specific build of a project
GET/v3/projects/{id}/builds/{build_id}/traceGet a trace of a specific build of a project
GET/v3/projects/{id}/deploy_keysGet a specific project's deploy keys
POST/v3/projects/{id}/deploy_keysAdd new deploy key to currently authenticated user
GET/v3/projects/{id}/deploy_keys/{key_id}Get single deploy key
DELETE/v3/projects/{id}/deploy_keys/{key_id}Delete deploy key for a project
DELETE/v3/projects/{id}/deploy_keys/{key_id}/disableDisable a deploy key for a project
POST/v3/projects/{id}/deploy_keys/{key_id}/enableEnable a deploy key for a project
GET/v3/projects/{id}/deploymentsGet all deployments of the project
GET/v3/projects/{id}/deployments/{deployment_id}Gets a specific deployment
GET/v3/projects/{id}/environmentsGet all environments of the project
POST/v3/projects/{id}/environmentsCreates a new environment
PUT/v3/projects/{id}/environments/{environment_id}Updates an existing environment
DELETE/v3/projects/{id}/environments/{environment_id}Deletes an existing environment
GET/v3/projects/{id}/eventsGet events for a single project
DELETE/v3/projects/{id}/forkRemove a forked_from relationship
POST/v3/projects/{id}/fork/{forked_from_id}Mark this project as forked from another
GET/v3/projects/{id}/hooksGet project hooks
POST/v3/projects/{id}/hooksAdd hook to project
GET/v3/projects/{id}/hooks/{hook_id}Get a project hook

Showing the first 100 of 358 endpoints; the full list is in the documentation.

Questions

Does the Gitlab API need an API key?

Yes. The Gitlab API uses OAuth authentication; the documentation explains how to get credentials.

Does the Gitlab API support HTTPS?

Yes, the Gitlab API is served over HTTPS.

How many endpoints does the Gitlab API have?

Its OpenAPI description lists 358 endpoints in version v3. The first 100 are shown on this page.

What are alternatives to the Gitlab API?

Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).