GitLab REST API
Complete DevOps platform REST API for CI/CD automation
GitLab's REST API provides comprehensive access to repositories, CI/CD pipelines, issue tracking, and project management. Developers use it to automate DevOps workflows, integrate GitLab with external tools, and build custom applications on top of GitLab's complete DevOps platform. The API supports everything from repository operations to advanced pipeline orchestration and security scanning.
https://gitlab.com/api/v4
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /projects | List all projects accessible to the authenticated user |
| GET | /projects/:id | Get details of a specific project by ID or URL-encoded path |
| POST | /projects | Create a new project with specified configuration |
| GET | /projects/:id/repository/commits | List commits in a project repository, filtered by ref_name or date range. Returns commit SHA, message, and author details. |
| GET | /projects/:id/pipelines | List CI/CD pipelines for a project, filtered by status or ref. Returns pipeline ID, status, and SHA. |
| POST | /projects/:id/pipeline | Trigger a new CI/CD pipeline run for a specified ref. Returns the created pipeline ID and status. |
| GET | /projects/:id/pipelines/:pipeline_id/jobs | List jobs in a specific pipeline, including job name, status, and stage. Requires pipeline_id in the path. |
| GET | /projects/:id/merge_requests | List merge requests for a project, filtered by state or author. Returns MR IID, title, and source branch. |
| POST | /projects/:id/merge_requests | Create a new merge request with source_branch and target_branch. Returns the created MR IID and web URL. |
| PUT | /projects/:id/merge_requests/:merge_request_iid/merge | Accept and merge a merge request identified by merge_request_iid. Optionally removes source branch after merge. |
| GET | /projects/:id/issues | List issues for a project, filtered by state, labels, or assignee. Returns issue IID, title, and status. |
| POST | /projects/:id/issues | Create a new issue in a project with title and description. Returns the created issue IID and web URL. |
| GET | /users | List all users in the GitLab instance, including username, email, and state. Admin access may show additional details. |
| GET | /groups | List all groups accessible to the authenticated user, including group ID, name, and visibility level. |
| GET | /projects/:id/repository/branches | List all branches in a project repository, returning branch name, commit SHA, and protected status. |
Sponsor this page
AvailableReach developers actively building with GitLab. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl --header "PRIVATE-TOKEN: glpat-xxxxxxxxxxxxxxxxxxxx" \
"https://gitlab.com/api/v4/projects/12345/pipelines" \
| jq '.[] | {id: .id, status: .status, ref: .ref}'
Use GitLab from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for GitLab. Paste your GitLab API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls GitLab directly with your credentials — no local install, works on mobile.
trigger_gitlab_pipeline
Trigger a CI/CD pipeline run for a specific project and branch with optional variables
create_merge_request
Create a merge request from source to target branch with title, description, and assignees
get_pipeline_status
Check the status of running pipelines and retrieve job logs for debugging
manage_project_issues
Create, update, and search issues across GitLab projects with filtering and labeling
analyze_repository_metrics
Retrieve commit history, contributor statistics, and code quality metrics for projects
Connect in 60 seconds
Paste your GitLab key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect GitLab to your AI →