GitLab Commit statuses API

Use this API to list the statuses recorded against a [commit](https://docs.gitlab.com/user/project/repository/commits/), and to add or update the status that an external [CI/CD job](https://docs.gitlab.com/ci/jobs/) reports for a commit.

Operations 2

GET /api/v4/projects/{id}/repository/commits/{sha}/statuses List all commit statuses #
POST /api/v4/projects/{id}/statuses/{sha} Create or update a commit pipeline status #

Documentation

📖
Documentation
https://docs.gitlab.com/api/openapi/
📖
Documentation
https://docs.gitlab.com/api/issues/
📖
Authentication
https://docs.gitlab.com/api/rest/authentication/
📖
Documentation
https://docs.gitlab.com/api/merge_requests/
📖
Documentation
https://docs.gitlab.com/api/pipelines/
📖
Documentation
https://docs.gitlab.com/api/jobs/
📖
Documentation
https://docs.gitlab.com/api/runners/
📖
Documentation
https://docs.gitlab.com/api/users/
📖
Documentation
https://docs.gitlab.com/api/repositories/
📖
Documentation
https://docs.gitlab.com/api/commits/
📖
Documentation
https://docs.gitlab.com/api/branches/
📖
Documentation
https://docs.gitlab.com/api/tags/
📖
Documentation
https://docs.gitlab.com/api/releases/
📖
Documentation
https://docs.gitlab.com/api/environments/
📖
Documentation
https://docs.gitlab.com/api/deployments/
📖
Documentation
https://docs.gitlab.com/api/pipeline_schedules/
📖
Documentation
https://docs.gitlab.com/api/labels/
📖
Documentation
https://docs.gitlab.com/api/milestones/
📖
Documentation
https://docs.gitlab.com/api/notes/
📖
Documentation
https://docs.gitlab.com/api/snippets/
📖
Documentation
https://docs.gitlab.com/api/packages/
📖
Documentation
https://docs.gitlab.com/api/container_registry/
📖
Documentation
https://docs.gitlab.com/api/vulnerabilities/
📖
Documentation
https://docs.gitlab.com/api/deploy_keys/
📖
Documentation
https://docs.gitlab.com/api/protected_branches/
📖
Documentation
https://docs.gitlab.com/api/wikis/
📖
Documentation
https://docs.gitlab.com/api/events/
📖
Documentation
https://docs.gitlab.com/api/search/
📖
Documentation
https://docs.gitlab.com/api/namespaces/
📖
Documentation
https://docs.gitlab.com/api/groups/
📖
Documentation
https://docs.gitlab.com/api/projects/
📖
Documentation
https://docs.gitlab.com/api/applications/
📖
Documentation
https://docs.gitlab.com/api/avatar/
📖
Documentation
https://docs.gitlab.com/api/broadcast_messages/
📖
Documentation
https://docs.gitlab.com/api/bulk_imports/
📖
Documentation
https://docs.gitlab.com/api/settings/
📖
Documentation
https://docs.gitlab.com/api/metadata/
📖
Documentation
https://docs.gitlab.com/api/version/
📖
Documentation
https://docs.gitlab.com/api/rest/
📖
APIReference
https://docs.gitlab.com/api/api_resources/
📖
RateLimits
https://docs.gitlab.com/security/rate_limits/
📖
Documentation
https://docs.gitlab.com/api/oauth2/
📖
Authentication
https://docs.gitlab.com/integration/oauth_provider/
📖
Documentation
https://docs.gitlab.com/user/project/integrations/webhooks.html
📖
APIReference
https://docs.gitlab.com/api/project_webhooks/

Specifications

Schemas & Data

📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-application-settings-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-node-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-site-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-application-setting-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-post-api-v4-geo-status-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-projects-id-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-cluster-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-batched-background-migration-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-ci-variable-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-dictionary-table-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-plan-limit-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-appearance-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-avatar-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-imports-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-import-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-metadata-schema.json

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-commit-statuses-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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-commit-statuses-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab REST Commit statuses API
  description: GitLab REST API used to interact with a GitLab installation.
  termsOfService: https://handbook.gitlab.com/handbook/legal/api-terms/
  version: '19.6'
  license:
    name: CC BY-SA 4.0
    url: https://gitlab.com/gitlab-org/gitlab/-/blob/master/LICENSE
    x-gitlab-description: The license applies to the OpenAPI specification document itself. For terms governing use of the GitLab API, see the termsOfService field.
servers:
- url: https://{hostname}
  description: GitLab REST API
  variables:
    hostname:
      default: gitlab.com
      description: Your GitLab instance hostname
security:
- http: []
- oauth2: []
- apiKey: []
tags:
- name: Commit Statuses
  description: 'Use this API to list the statuses recorded against a

    commit, and to add or update the status

    that an external CI/CD job reports for a commit.'
  x-displayName: Commit statuses
  externalDocs:
    url: https://docs.gitlab.com/api/commits/
paths:
  /api/v4/projects/{id}/repository/commits/{sha}/statuses:
    get:
      operationId: getApiV4ProjectsIdRepositoryCommitsShaStatuses
      summary: List all commit statuses
      description: Lists all commit statuses for a specified project.
      tags:
      - Commit Statuses
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesCommitStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: sha
        required: true
        description: Commit SHA.
        schema:
          type: string
        in: path
        example: 18f3e63d05582537db6d183d9d557be09e1f90c8
      - name: ref
        required: false
        description: Name of the branch or tag. Defaults to the default branch.
        schema:
          type:
          - string
          - 'null'
        in: query
        example: develop
      - name: stage
        required: false
        description: Filter statuses by [build stage](https://docs.gitlab.com/ci/yaml/#stages). For example, `test`.
        schema:
          type:
          - string
          - 'null'
        in: query
        example: test
      - name: name
        required: false
        description: Filter statuses by [job name](https://docs.gitlab.com/ci/yaml/#job-keywords).
        schema:
          type:
          - string
          - 'null'
        in: query
        example: bundler:audit
      - name: pipeline_id
        required: false
        description: Filter statuses by pipeline ID.
        schema:
          type:
          - integer
          - 'null'
        in: query
        example: 1234
      - name: all
        required: false
        description: If `true`, includes all statuses instead of only the latest.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: order_by
        required: false
        description: Sort results by the specified field.
        schema:
          type: string
          enum:
          - id
          - pipeline_id
          default: id
        in: query
      - name: sort
        required: false
        description: Sort statuses in ascending or descending order. Defaults to `asc`.
        schema:
          type:
          - string
          - 'null'
          enum:
          - asc
          - desc
          - null
        in: query
      - name: page
        required: false
        description: Page number of results to retrieve.
        schema:
          type: integer
          default: 1
        in: query
        example: 1
      - name: per_page
        required: false
        description: Number of items to list per page.
        schema:
          type: integer
          default: 20
        in: query
        example: 20
  /api/v4/projects/{id}/statuses/{sha}:
    post:
      operationId: postApiV4ProjectsIdStatusesSha
      summary: Create or update a commit pipeline status
      description: Creates or updates the status of a commit represented by a job in an `external` stage. If the commit is associated with a merge request, target the commit in the merge request source branch.
      tags:
      - Commit Statuses
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesCommitStatus'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Another update to this commit status is in progress
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: sha
        required: true
        description: Commit SHA.
        schema:
          type: string
        in: path
        example: 18f3e63d05582537db6d183d9d557be09e1f90c8
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdStatusesShaRequest'
components:
  schemas:
    APIEntitiesCustomAttribute:
      type: object
      properties:
        key:
          type: string
          example: foo
        value:
          type: string
          example: bar
    postApiV4ProjectsIdStatusesShaRequest:
      type: object
      properties:
        state:
          type: string
          enum:
          - pending
          - running
          - success
          - failed
          - canceled
          - skipped
          description: State of the status.
          minLength: 1
        ref:
          type:
          - string
          - 'null'
          description: Branch or tag that the status refers to. Must be 255 characters or fewer.
          example: develop
        target_url:
          type:
          - string
          - 'null'
          description: Target URL to associate with this status. Must be 255 characters or fewer.
          example: https://gitlab.example.com/janedoe/gitlab-foss/builds/91
        description:
          type:
          - string
          - 'null'
          description: Short description of the status. Must be 255 characters or fewer.
        name:
          type:
          - string
          - 'null'
          description: String label to differentiate this status from the status of other systems.
          example: coverage
        context:
          type:
          - string
          - 'null'
          description: String label to differentiate this status from the status of other systems.
          example: coverage
        coverage:
          type:
          - number
          - 'null'
          description: Total code coverage.
          example: 100.0
        pipeline_id:
          type:
          - integer
          - 'null'
          description: ID of the pipeline to set the status for. Use when multiple pipelines exist for the same commit SHA.
      required:
      - state
    APIEntitiesCommitStatus:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 93
        sha:
          type: string
          example: 18f3e63d05582537db6d183d9d557be09e1f90c8
        ref:
          type: string
          example: develop
        status:
          type: string
          example: success
        name:
          type: string
          example: default
        target_url:
          type: string
          example: https://gitlab.example.com/janedoe/gitlab-foss/builds/91
        description:
          type: string
        created_at:
          type: string
          format: date-time
          example: '2016-01-19T09:05:50.355Z'
        started_at:
          type: string
          format: date-time
          example: '2016-01-20T08:40:25.832Z'
        finished_at:
          type: string
          format: date-time
          example: '2016-01-21T08:40:25.832Z'
        allow_failure:
          type: boolean
          example: false
        coverage:
          type: number
          format: float
          example: 98.29
        pipeline_id:
          type: integer
          format: int64
          example: 101
        author:
          $ref: '#/components/schemas/APIEntitiesUserBasic'
    APIEntitiesUserBasic:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        username:
          type: string
          example: admin
        public_email:
          type: string
          example: john@example.com
        name:
          type: string
          example: Administrator
        state:
          type: string
          example: active
        locked:
          type: boolean
        avatar_url:
          type: string
          example: https://gravatar.com/avatar/1
        avatar_path:
          type: string
          example: /user/avatar/28/The-Big-Lebowski-400-400.png
        custom_attributes:
          type: array
          items:
            $ref: '#/components/schemas/APIEntitiesCustomAttribute'
        web_url:
          type: string
          example: https://gitlab.example.com/root
  securitySchemes:
    http:
      type: http
      scheme: bearer
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://gitlab.com/oauth/authorize
          tokenUrl: https://gitlab.com/oauth/token
          refreshUrl: https://gitlab.com/oauth/token
          scopes:
            api: Grants complete read/write access to the API, including all groups and projects, the container registry, the dependency proxy, and the package registry.
            read_api: Grants read access to the API, including all groups and projects, the container registry, and the package registry.
            read_user: Grants read-only access to your profile through the /user API endpoint, which includes username, public email, and full name. Also grants access to read-only API endpoints under /users.
            create_runner: Grants create access to the runners.
            manage_runner: Grants access to manage the runners.
            k8s_proxy: Grants permission to perform Kubernetes API calls using the agent for Kubernetes.
            self_rotate: Grants permission for token to rotate itself.
            mcp: Grants read-write access to remote Model Context Protocol (MCP) server for tools execution.
            mcp_orbit: Grants access to the Orbit Knowledge Graph MCP server for graph queries and schema retrieval.
    apiKey:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header