GitLab Projects API

The Projects API from GitLab — 17 operation(s) for projects.

Business capability
Software Construction Management BC-4200.40

Operations 26

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

DELETE /api/v4/projects/{id}/repository/merged_branches Delete all merged branches in a project · Delete api V4 projects id repository merged branches #
Ask an LLM
“How do I clean up every branch that has already been merged in a GitLab project?”
“Can I bulk-remove merged branches from a repository in one call?”
Tell an agent destructive · confirm first
Delete all merged branches in project {id}.
Clean up the already-merged branches from the {id} repository.
GET /api/v4/projects/{id}/repository/branches/{branch} Get details of a single branch · Get api V4 projects id repository branches branch #
Ask an LLM
“Where can I see the details and latest commit of one specific branch?”
“What does a single repository branch record look like for a project?”
Tell an agent
Show me the details of branch {branch} in project {id}.
Fetch the {branch} branch record from project {id}.
DELETE /api/v4/projects/{id}/repository/branches/{branch} Delete a single branch · Delete api V4 projects id repository branches branch #
Ask an LLM
“How do I delete one named branch from a project repository?”
“Can I remove a specific feature branch I no longer need?”
Tell an agent destructive · confirm first
Delete branch {branch} from project {id}.
Remove the {branch} branch in repository {id}.
HEAD /api/v4/projects/{id}/repository/branches/{branch} Check whether a branch exists · Head api V4 projects id repository branches branch #
Ask an LLM
“Is there a quick way to check if a branch exists without fetching its details?”
“Can I verify a branch name is present in a repository before pushing to it?”
Tell an agent
Check whether branch {branch} exists in project {id}.
Confirm that project {id} has a branch called {branch}.
GET /api/v4/projects/{id}/repository/branches List a project's repository branches · Get api V4 projects id repository branches #
Ask an LLM
“How do I list all the branches in a GitLab project repository?”
“Can I search branches by name or with a regex pattern?”
Tell an agent
List the branches in project {id}.
Find branches in project {id} whose names match {search}.
POST /api/v4/projects/{id}/repository/branches Create a new branch from a ref · Post api V4 projects id repository branches #
Ask an LLM
“How do I create a new branch from main or a specific commit?”
“Can I branch off a tag or commit SHA instead of another branch?”
Tell an agent
Create branch {branch} from {ref} in project {id}.
Start a new branch {branch} in repository {id} off commit {ref}.
PUT /api/v4/projects/{id}/repository/branches/{branch}/unprotect Remove protection from a branch · Put api V4 projects id repository branches branch unprotect #
Ask an LLM
“How do I unprotect a branch so anyone with access can push to it?”
“Can I lift branch protection from a single branch?”
Tell an agent
Unprotect branch {branch} in project {id}.
Remove the protection rules from {branch} in repository {id}.
PUT /api/v4/projects/{id}/repository/branches/{branch}/protect Protect a branch · Put api V4 projects id repository branches branch protect #
Ask an LLM
“How do I protect a branch so it can't be force-pushed or deleted?”
“Can I protect a branch but still allow developers to push or merge into it?”
Tell an agent
Protect branch {branch} in project {id}.
Protect {branch} in project {id} and set developers-can-merge to {developers_can_merge}.
GET /api/v4/projects/{id}/badges/{badge_id} Get a project badge · GitLab Gets a Badge of a Project #
Ask an LLM
“How do I look up one badge on a project by its ID?”
“What link and image URL does a specific project badge use?”
Tell an agent
Show project badge {badge_id} on project {id}.
Get the link and image URLs of badge {badge_id} in project {id}.
PUT /api/v4/projects/{id}/badges/{badge_id} Update a project badge · GitLab Updates a Badge of a Project #
Ask an LLM
“How do I change the image or link of an existing project badge?”
“Can I rename a badge that's already on my project?”
Tell an agent
Change the image URL of project badge {badge_id} on {id} to {image_url}.
Point project badge {badge_id} in {id} at link {link_url}.
DELETE /api/v4/projects/{id}/badges/{badge_id} Remove a badge from a project · GitLab Removes a Badge from the Project #
Ask an LLM
“How do I take a badge off my project's page?”
“Can I delete a single project badge without touching group badges?”
Tell an agent destructive · confirm first
Remove badge {badge_id} from project {id}.
Delete the project badge {badge_id} on {id}.
GET /api/v4/projects/{id}/badges List a project's badges · GitLab Gets a List of Project Badges Viewable by the Authenticated User #
Ask an LLM
“Which badges are shown on a project?”
“Can I filter a project's badges by name?”
Tell an agent
List all badges on project {id}.
Find badges named {name} on project {id}.
POST /api/v4/projects/{id}/badges Add a badge to a project · GitLab Adds a Badge to a Project #
Ask an LLM
“How do I add a pipeline status or coverage badge to a GitLab project?”
“What do I need to supply to create a new project badge?”
Tell an agent
Add a badge to project {id} linking to {link_url} with image {image_url}.
Create a project badge called {name} on {id} using image {image_url} and link {link_url}.
GET /api/v4/projects/{id}/badges/render Preview how a project badge will render · GitLab Preview a Badge from a Project #
Ask an LLM
“Can I preview a project badge's resolved URLs before adding it?”
“How do I check what placeholders in a badge URL resolve to for my project?”
Tell an agent
Preview a badge for project {id} with link {link_url} and image {image_url}.
Render the project badge URLs {image_url} and {link_url} for {id} without saving.
DELETE /api/v4/projects/{id}/access_requests/{user_id} Deny a user's request to join a project · GitLab Denies an Access Request for the Given User #
Ask an LLM
“How do I reject someone who requested access to my project?”
“Can I deny a pending project access request for a specific user?”
Tell an agent destructive · confirm first
Deny user {user_id}'s access request on project {id}.
Reject the pending request from {user_id} to join project {id}.
PUT /api/v4/projects/{id}/access_requests/{user_id}/approve Approve a user's request to join a project · GitLab Approves an Access Request for the Given User #
Ask an LLM
“How do I approve someone who asked to join my project?”
“Can I choose the access level when approving a project access request?”
Tell an agent
Approve user {user_id}'s request to join project {id}.
Let {user_id} into project {id} with access level {access_level}.
GET /api/v4/projects/{id}/access_requests List pending access requests for a project · GitLab Gets a List of Access Requests for a Project #
Ask an LLM
“Who has requested access to my project and is still waiting?”
“Where can I see the pending membership requests on a project?”
Tell an agent
List the pending access requests for project {id}.
Show who is waiting to be let into project {id}.
POST /api/v4/projects/{id}/access_requests Request access to a project for yourself · GitLab Requests Access for the Authenticated User to a Project #
Ask an LLM
“How do I ask to become a member of a project I can see but can't contribute to?”
“Can I submit an access request to a project on my own behalf?”
Tell an agent
Request access to project {id} for me.
Submit my request to join project {id}.
PUT /api/v4/projects/{id}/alert_management_alerts/{alert_iid}/metric_images/{metric_image_id} Update a metric image on an alert · Put api V4 projects id alert management alerts alert iid metric images metric… #
Ask an LLM
“How do I change the link attached to a metric image on an alert?”
“Can I edit the link text of a chart I already uploaded to an alert?”
Tell an agent
Set the URL of metric image {metric_image_id} on alert {alert_iid} in project {id} to {url}.
Change the link text of metric image {metric_image_id} on alert {alert_iid} in {id} to {url_text}.
DELETE /api/v4/projects/{id}/alert_management_alerts/{alert_iid}/metric_images/{metric_image_id} Remove a metric image from an alert · Delete api V4 projects id alert management alerts alert iid metric images… #
Ask an LLM
“How do I delete a chart screenshot I attached to an alert by mistake?”
“Can I remove one metric image from an alert without affecting the others?”
Tell an agent destructive · confirm first
Remove metric image {metric_image_id} from alert {alert_iid} in project {id}.
Delete the metric image {metric_image_id} attached to alert {alert_iid} of {id}.
GET /api/v4/projects/{id}/alert_management_alerts/{alert_iid}/metric_images List metric images on an alert · Get api V4 projects id alert management alerts alert iid metric images #
Ask an LLM
“Which metric images have been attached to an incident alert?”
“Can I see all the charts uploaded to an alert in one list?”
Tell an agent
List the metric images on alert {alert_iid} in project {id}.
Show every chart attached to alert {alert_iid} of project {id}.
POST /api/v4/projects/{id}/alert_management_alerts/{alert_iid}/metric_images Upload a metric image to an alert · Post api V4 projects id alert management alerts alert iid metric images #
Ask an LLM
“How do I attach a screenshot of a metrics chart to an alert?”
“Can I link an uploaded alert image back to the dashboard it came from?”
Tell an agent
Upload {file} as a metric image on alert {alert_iid} in project {id}.
Attach image {file} to alert {alert_iid} of {id} with a link to {url}.
POST /api/v4/projects/{id}/alert_management_alerts/{alert_iid}/metric_images/authorize Authorize a metric image upload for an alert · Post api V4 projects id alert management alerts alert iid metric images… #
Ask an LLM
“What is the Workhorse authorize step before uploading an alert metric image?”
“Is there a pre-upload authorization call for attaching images to alerts?”
Tell an agent
Authorize a metric image file upload for alert {alert_iid} in project {id}.
Run the Workhorse upload authorization for alert {alert_iid} on {id}.
GET /api/v4/projects/{id}/jobs List CI jobs in a project · GitLab List Jobs for a Project #
Ask an LLM
“How do I see all the CI/CD jobs that have run in a project?”
“Can I list only failed or pending jobs for a project?”
Tell an agent
List the CI jobs in project {id}.
Show jobs in project {id} with status {scope}.
GET /api/v4/projects/{id}/jobs/{job_id} Get a single CI job · GitLab Get a Single Job by ID #
Ask an LLM
“How do I check the status and details of one CI job by its ID?”
“What information does GitLab return for a specific pipeline job?”
Tell an agent
Show job {job_id} in project {id}.
Get the status of CI job {job_id} from project {id}.
POST /api/v4/projects/{id}/jobs/{job_id}/play Run a manual CI job · GitLab Run a Manual Job #
Ask an LLM
“How do I start a manual job that's waiting in a pipeline?”
“Can I pass custom variables when I play a manual job?”
Tell an agent
Play manual job {job_id} in project {id}.
Run manual job {job_id} in {id} with variables {job_variables_attributes}.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gitlab:gitlab-projects-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gitlab-projects-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab Projects API
  version: v4
  description: An OpenAPI definition for the GitLab REST API.
  termsOfService: https://about.gitlab.com/terms/
  license:
    name: CC BY-SA 4.0
    url: https://gitlab.com/gitlab-org/gitlab/-/blob/master/LICENSE
servers:
- url: https://www.gitlab.com/api/
security:
- ApiKeyAuth: []
tags:


# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/gitlab/refs/heads/main/openapi/gitlab-projects-api-openapi.yml