GitLab CI/CD ci_lint API

Operations related to linting a CI config file

Operations 2

GET /api/v4/projects/{id}/ci/lint Validates a CI YAML configuration with a namespace #
POST /api/v4/projects/{id}/ci/lint Validate a CI YAML configuration with a namespace #

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-ci-ci-lint-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-ci-ci-lint-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab access_requests Ci Lint API
  version: v4
  description: Operations related to access requests
servers:
- url: https://gitlab.com
tags:
- name: ci_lint
  description: Operations related to linting a CI config file
paths:
  /api/v4/projects/{id}/ci/lint:
    get:
      summary: Validates a CI YAML configuration with a namespace
      description: "Checks if a project’s .gitlab-ci.yml configuration in a given commit (by default HEAD of the\n        project’s default branch) is valid"
      parameters:
      - in: query
        name: sha
        description: 'Deprecated: Use content_ref instead'
        required: false
        schema:
          type: string
      - in: query
        name: content_ref
        description: The CI/CD configuration content is taken from this commit SHA, branch or tag. Defaults to the HEAD of the project's default branch
        required: false
        schema:
          type: string
      - in: query
        name: dry_run
        description: Run pipeline creation simulation, or only do static check. This is false by default
        required: false
        schema:
          type: boolean
          default: false
      - in: query
        name: include_jobs
        description: "If the list of jobs that would exist in a static check or pipeline\n        simulation should be included in the response. This is false by default"
        required: false
        schema:
          type: boolean
      - in: query
        name: ref
        description: 'Deprecated: Use dry_run_ref instead'
        required: false
        schema:
          type: string
      - in: query
        name: dry_run_ref
        description: Branch or tag used as context when executing a dry run. Defaults to the default branch of the project. Only used when dry_run is true
        required: false
        schema:
          type: string
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Validates a CI YAML configuration with a namespace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_Ci_Lint_Result'
        '404':
          description: Not found
      tags:
      - ci_lint
      operationId: getApiV4ProjectsIdCiLint
    post:
      summary: Validate a CI YAML configuration with a namespace
      description: Checks if CI/CD YAML configuration is valid. This endpoint has namespace specific context
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Validate a CI YAML configuration with a namespace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_Ci_Lint_Result'
      tags:
      - ci_lint
      operationId: postApiV4ProjectsIdCiLint
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdCiLint'
        required: true
components:
  schemas:
    postApiV4ProjectsIdCiLint:
      type: object
      properties:
        content:
          type: string
          description: Content of .gitlab-ci.yml
        dry_run:
          type: boolean
          description: Run pipeline creation simulation, or only do static check. This is false by default
          default: false
        include_jobs:
          type: boolean
          description: "If the list of jobs that would exist in a static check or pipeline\n        simulation should be included in the response. This is false by default"
        ref:
          type: string
          description: When dry_run is true, sets the branch or tag to use. Defaults to the project’s default branch when not set
      required:
      - content
      description: Validate a CI YAML configuration with a namespace
    API_Entities_Ci_Lint_Result:
      type: object
      properties:
        valid:
          type: boolean
        errors:
          type: array
          items:
            type: string
          example:
          - variables config should be a hash of key value pairs
        warnings:
          type: array
          items:
            type: string
          example:
          - jobs:job may allow multiple pipelines ...
        merged_yaml:
          type: string
          example: "---\\n:another_test:\\n  :stage: test\\n\n          :script: echo 2\\n:test:\\n  :stage: test\\n  :script: echo 1\\n"
        includes:
          type: array
          items:
            $ref: '#/components/schemas/API_Entities_Ci_Lint_Result_Include'
          example:
          - blob: https://gitlab.com/root/example-project/-/blob/...
        jobs:
          type: array
          items:
            type: object
          example:
          - name: test
            script:
            - ls
      required:
      - valid
      - errors
      - warnings
      - merged_yaml
      - includes
      description: API_Entities_Ci_Lint_Result model
    API_Entities_Ci_Lint_Result_Include:
      type: object
      properties:
        type:
          type: string
          example: local
        location:
          type: string
          example: .gitlab/ci/build-images.gitlab-ci.yml
        blob:
          type: string
          example: https://gitlab.com/gitlab-org/gitlab/-/blob/e52d6d0246d7375291850e61f0abc101fbda9dc2/.gitlab/ci/build-images.gitlab-ci.yml
        raw:
          type: string
          example: https://gitlab.com/gitlab-org/gitlab/-/raw/e52d6d0246d7375291850e61f0abc101fbda9dc2/.gitlab/ci/build-images.gitlab-ci.yml
        extra:
          type: object
          example:
            job_name: test
            project: gitlab-org/gitlab
            ref: master
        context_project:
          type: string
          example: gitlab-org/gitlab
        context_sha:
          type: string
          example: e52d6d0246d7375291850e61f0abc101fbda9dc2
      required:
      - type
      - location
      - blob
      - raw
      - extra
      - context_project
      - context_sha
  securitySchemes:
    access_token_header:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header
    access_token_query:
      type: apiKey
      name: private_token
      in: query