GitLab Search API

Use this API to [search across GitLab](https://docs.gitlab.com/user/search/) in an instance, a group, or a project, and to retrieve information about [advanced search migrations](https://docs.gitlab.com/integration/advanced_search/elasticsearch/#advanced-search-migrations). Every call to this API requires authentication. Retrieving advanced search migrations requires administrator access. Some scopes are available for [basic search](https://docs.gitlab.com/user/search/#available-scopes). When [advanced search](https://docs.gitlab.com/user/search/advanced_search/#available-scopes) or [exact code search](https://docs.gitlab.com/user/search/exact_code_search/#available-scopes) is enabled, additional scopes become available. To use basic search instead, see [specify a search type](https://docs.gitlab.com/user/search/#specify-a-search-type). These endpoints support [offset-based pagination](https://docs.gitlab.com/api/rest/#offset-based-pagination).

Operations 6

GET /api/v4/projects/{id}/(-/)search/semantic Search project code using natural language #
GET /api/v4/admin/search/migrations List all advanced search migrations #
GET /api/v4/admin/search/migrations/{migration_id} Retrieve an advanced search migration #
GET /api/v4/search Search an instance #
GET /api/v4/groups/{id}/(-/)search Search on GitLab within a group #
GET /api/v4/projects/{id}/(-/)search Search a project #

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-search-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-search-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab REST Search 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: Search
  description: 'Use this API to search across GitLab in an instance, a group,

    or a project, and to retrieve information about

    advanced search migrations.


    Every call to this API requires authentication. Retrieving advanced search migrations requires

    administrator access.


    Some scopes are available for basic search.

    When advanced search or

    exact code search is

    enabled, additional scopes become available. To use basic search instead, see

    specify a search type.


    These endpoints support offset-based pagination.'
  x-displayName: Search
  externalDocs:
    url: https://docs.gitlab.com/api/search/
paths:
  /api/v4/projects/{id}/(-/)search/semantic:
    get:
      operationId: getApiV4ProjectsIdDashSearchSemantic
      summary: Search project code using natural language
      description: 'Introduced in GitLab 18.11.


        Searches indexed project code using semantic (meaning-based) similarity rather than

        keyword matching. Use this when you do not know the exact symbol or file name, or

        to discover how a behavior is implemented across the codebase.


        Primary use cases:

        - When you do not know the exact symbol or file path

        - To see how a behavior or feature is implemented across the codebase

        - To discover related implementations (clients, jobs, workers)


        How to use:

        - Provide a concise, specific query with concrete keywords

        - Use directory_path to narrow scope (e.g. "app/services/")

        - Prefer precise intent over broad terms


        Results are grouped by file. Each file includes merged line ranges with content

        and a relevance score (0.0-1.0). The response includes an overall confidence

        level (high/medium/low/unknown) based on score distribution. Results are

        filtered by Duo context exclusion settings.


        Requires semantic code search to be enabled and indexed for the project namespace.'
      tags:
      - Search
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesAiSemanticCodeResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - project not found or semantic code search unavailable
        '422':
          description: Unprocessable entity - project has no embeddings
        '429':
          description: Too many requests
        '503':
          description: Service unavailable - search backend timed out
        '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: q
        required: true
        description: Natural language search query, for example `authentication middleware` or `rate limiting logic`.
        schema:
          type:
          - string
          - 'null'
          maxLength: 1000
        in: query
      - name: directory_path
        required: false
        description: Restrict search to files under this directory path, for example `app/services/`. Must be a relative path with no leading slash and no `..` segments.
        schema:
          type:
          - string
          - 'null'
          maxLength: 100
        in: query
      - name: knn
        required: false
        description: 'Number of nearest neighbours to retrieve internally (default: 64). Higher values improve recall at the cost of latency.'
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 64
        in: query
      - name: limit
        required: false
        description: 'Maximum number of results to return (default: 20).'
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
        in: query
      x-gitlab-lifecycle: beta
  /api/v4/admin/search/migrations:
    get:
      operationId: getApiV4AdminSearchMigrations
      summary: List all advanced search migrations
      description: Lists all advanced search migrations for the GitLab instance.
      tags:
      - Search
      responses:
        '200':
          description: OK
        '401':
          description: 401 Unauthorized
        '403':
          description: 403 Forbidden
        '404':
          description: 404 Not found
      x-gitlab-tier: premium
  /api/v4/admin/search/migrations/{migration_id}:
    get:
      operationId: getApiV4AdminSearchMigrationsMigrationId
      summary: Retrieve an advanced search migration
      description: Retrieves a specified advanced search migration by migration version or name.
      tags:
      - Search
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesSearchMigration'
        '401':
          description: 401 Unauthorized
        '403':
          description: 403 Forbidden
        '404':
          description: 404 Not found
        '400':
          description: Bad Request
      parameters:
      - name: migration_id
        required: true
        description: Version or name of the search migration.
        schema:
          oneOf:
          - type: integer
          - type: string
        in: path
      x-gitlab-tier: premium
  /api/v4/search:
    get:
      operationId: getApiV4Search
      summary: Search an instance
      description: Searches for a term across the entire GitLab instance. The response depends on the requested scope.
      tags:
      - Search
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
      parameters:
      - name: search
        required: true
        description: Search query.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: scope
        required: true
        description: Scope of the search.
        schema:
          type: string
          enum:
          - wiki_blobs
          - blobs
          - commits
          - notes
          - projects
          - groups
          - issues
          - work_items
          - merge_requests
          - milestones
          - snippet_titles
          - users
          minLength: 1
        in: query
      - name: state
        required: false
        description: Filter results by state. Applies only to the `issues`, `work_items`, and `merge_requests` scopes.
        schema:
          type:
          - string
          - 'null'
          enum:
          - all
          - opened
          - closed
          - merged
          - null
        in: query
      - name: confidential
        required: false
        description: If `true`, returns only confidential results. If `false`, returns only non-confidential results. Applies only to the `issues` and `work_items` scopes.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: type
        required: false
        description: 'Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.'
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
        in: query
        style: form
        explode: false
      - name: include_archived
        required: false
        description: If `true`, includes archived projects in the search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/493281) in GitLab 18.7.
        schema:
          type: boolean
          default: false
        in: query
      - name: fields
        required: false
        description: Fields to search. Supports only `issues` and `merge_requests` scopes. Premium and Ultimate only.
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
            enum:
            - title
        in: query
        style: form
        explode: false
      - name: exclude_forks
        required: false
        description: If `true`, excludes forked projects from the search. If omitted, forks are excluded. Available for exact code search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/493281) in GitLab 18.7.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: num_context_lines
        required: false
        description: Number of context lines to include around each match in the results. Available for advanced and exact code search only. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/583217) in GitLab 18.11.
        schema:
          type:
          - integer
          - 'null'
          minimum: 0
          maximum: 20
        in: query
      - name: regex
        required: false
        description: If `true`, uses regular expressions to search for code. If omitted, regular expressions are used. Available for exact code search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/521686) in GitLab 18.9.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: source_branch
        required: false
        description: Filter merge requests by source branch. Available with advanced search and the merge_requests scope.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: target_branch
        required: false
        description: Filter merge requests by target branch. Available with advanced search and the merge_requests scope.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: author_username
        required: false
        description: Filter by author username. A username that matches no user is ignored. Available with advanced search and the issues, merge_requests and work_items scopes.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: label_name
        required: false
        description: Filter by label name. A result must carry every name that resolves to an existing label; names that match no label are ignored. Maximum 30 names. Available with advanced search and the issues, merge_requests and work_items scopes.
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
        in: query
        style: form
        explode: false
      - name: not
        required: false
        description: Filter out results matching the parameters supplied. Supplying a filter together with its negation matches either condition, which widens the result set.
        schema:
          type:
          - object
          - 'null'
        in: query
      - name: not[source_branch]
        required: false
        description: Exclude merge requests with this source branch
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: not[target_branch]
        required: false
        description: Exclude merge requests with this target branch
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: not[author_username]
        required: false
        description: Exclude results authored by this username
        schema:
          type:
          - string
          - '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/groups/{id}/(-/)search:
    get:
      operationId: getApiV4GroupsIdDashSearch
      summary: Search on GitLab within a group
      description: This feature was introduced in GitLab 10.5.
      tags:
      - Search
      responses:
        '200':
          description: OK
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the group.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: search
        required: true
        description: Search query.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: scope
        required: true
        description: Scope of the search.
        schema:
          type: string
          enum:
          - wiki_blobs
          - blobs
          - commits
          - notes
          - projects
          - groups
          - issues
          - work_items
          - merge_requests
          - milestones
          - users
          minLength: 1
        in: query
      - name: state
        required: false
        description: Filter results by state. Applies only to the `issues`, `work_items`, and `merge_requests` scopes.
        schema:
          type:
          - string
          - 'null'
          enum:
          - all
          - opened
          - closed
          - merged
          - null
        in: query
      - name: confidential
        required: false
        description: If `true`, returns only confidential results. If `false`, returns only non-confidential results. Applies only to the `issues` and `work_items` scopes.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: type
        required: false
        description: 'Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.'
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
        in: query
        style: form
        explode: false
      - name: include_archived
        required: false
        description: If `true`, includes archived projects in the search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/493281) in GitLab 18.7.
        schema:
          type: boolean
          default: false
        in: query
      - name: fields
        required: false
        description: Fields to search. Supports only `issues` and `merge_requests` scopes. Premium and Ultimate only.
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
            enum:
            - title
        in: query
        style: form
        explode: false
      - name: exclude_forks
        required: false
        description: If `true`, excludes forked projects from the search. If omitted, forks are excluded. Available for exact code search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/493281) in GitLab 18.7.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: num_context_lines
        required: false
        description: Number of context lines to include around each match in the results. Available for advanced and exact code search only. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/583217) in GitLab 18.11.
        schema:
          type:
          - integer
          - 'null'
          minimum: 0
          maximum: 20
        in: query
      - name: regex
        required: false
        description: If `true`, uses regular expressions to search for code. If omitted, regular expressions are used. Available for exact code search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/521686) in GitLab 18.9.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: source_branch
        required: false
        description: Filter merge requests by source branch. Available with advanced search and the merge_requests scope.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: target_branch
        required: false
        description: Filter merge requests by target branch. Available with advanced search and the merge_requests scope.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: author_username
        required: false
        description: Filter by author username. A username that matches no user is ignored. Available with advanced search and the issues, merge_requests and work_items scopes.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: label_name
        required: false
        description: Filter by label name. A result must carry every name that resolves to an existing label; names that match no label are ignored. Maximum 30 names. Available with advanced search and the issues, merge_requests and work_items scopes.
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
        in: query
        style: form
        explode: false
      - name: not
        required: false
        description: Filter out results matching the parameters supplied. Supplying a filter together with its negation matches either condition, which widens the result set.
        schema:
          type:
          - object
          - 'null'
        in: query
      - name: not[source_branch]
        required: false
        description: Exclude merge requests with this source branch
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: not[target_branch]
        required: false
        description: Exclude merge requests with this target branch
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: not[author_username]
        required: false
        description: Exclude results authored by this username
        schema:
          type:
          - string
          - '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}/(-/)search:
    get:
      operationId: getApiV4ProjectsIdDashSearch
      summary: Search a project
      description: Searches for content in a specified project.
      tags:
      - Search
      responses:
        '200':
          description: OK
        '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: search
        required: true
        description: Search query.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: scope
        required: true
        description: Scope of the search.
        schema:
          type: string
          enum:
          - issues
          - work_items
          - merge_requests
          - milestones
          - notes
          - wiki_blobs
          - commits
          - blobs
          - users
          minLength: 1
        in: query
      - name: ref
        required: false
        description: Name of the repository branch or tag. If omitted, uses the default branch.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: state
        required: false
        description: Filter results by state. Applies only to the `issues`, `work_items`, and `merge_requests` scopes.
        schema:
          type:
          - string
          - 'null'
          enum:
          - all
          - opened
          - closed
          - merged
          - null
        in: query
      - name: confidential
        required: false
        description: If `true`, returns only confidential results. If `false`, returns only non-confidential results. Applies only to the `issues` and `work_items` scopes.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: type
        required: false
        description: 'Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.'
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
        in: query
        style: form
        explode: false
      - name: fields
        required: false
        description: Fields to search. Supports only `issues` and `merge_requests` scopes. Premium and Ultimate only.
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
            enum:
            - title
        in: query
        style: form
        explode: false
      - name: num_context_lines
        required: false
        description: Number of context lines to include around each match in the results. Available for advanced and exact code search only. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/583217) in GitLab 18.11.
        schema:
          type:
          - integer
          - 'null'
          minimum: 0
          maximum: 20
        in: query
      - name: regex
        required: false
        description: If `true`, uses regular expressions to search for code. If omitted, regular expressions are used. Available for exact code search. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/work_items/521686) in GitLab 18.9.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: source_branch
        required: false
        description: Filter merge requests by source branch. Available with advanced search and the merge_requests scope.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: target_branch
        required: false
        description: Filter merge requests by target branch. Available with advanced search and the merge_requests scope.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: author_username
        required: false
        description: Filter by author username. A username that matches no user is ignored. Available with advanced search and the issues, merge_requests and work_items scopes.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: label_name
        required: false
        description: Filter by label name. A result must carry every name that resolves to an existing label; names that match no label are ignored. Maximum 30 names. Available with advanced search and the issues, merge_requests and work_items scopes.
        schema:
          type:
          - array
          - 'null'
          items:
            type: string
        in: query
        style: form
        explode: false
      - name: not
        required: false
        description: Filter out results matching the parameters supplied. Supplying a filter together with its negation matches either condition, which widens the result set.
        schema:
          type:
          - object
          - 'null'
        in: query
      - name: not[source_branch]
        required: false
        description: Exclude merge requests with this source branch
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: not[target_branch]
        required: false
        description: Exclude merge requests with this target branch
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: not[author_username]
        required: false
        description: Exclude results authored by this username
        schema:
          type:
          - string
          - '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
components:
  schemas:
    APIEntitiesAiSemanticCodeGroupedResult:
      type: object
      properties:
        path:
          type: string
          example: app/models/user.rb
        blob_id:
          type: string
          example: abc123def456
        file_url:
          type: string
          example: https://gitlab.com/group/project/-/blob/main/user.rb
        score:
          type: number
          example: 0.92
        snippet_ranges:
          type: array
          items:
            $ref: '#/components/schemas/APIEntitiesAiSemanticCodeSnippetRange'
    APIEntitiesAiSemanticCodeResponse:
      type: object
      properties:
        confidence:
          type: string
          example: high
        results:
          type: array
          items:
            $ref: '#/components/schemas/APIEntitiesAiSemanticCodeGroupedResult'
    APIEntitiesAiSemanticCodeSnippetRange:
      type: object
      properties:
        start_line:
          type: integer
          example: 42
        end_line:
          type: integer
          example: 44
        content:
          type: string
          example: "def authenticate\n  ...\nend"
        score:
          type: number
          example: 0.85
    APIEntitiesSearchMigration:
      type: object
      properties:
        version:
          type: integer
          example: 20230427555555
        name:
          type: string
          example: BackfillHiddenOnMergeRequests
        started_at:
          type: string
          format: date-time
          example: '2023-05-14T12:30:50.355Z'
        completed_at:
          type: string
          format: date-time
          example: '2023-05-16T12:30:50.355Z'
        completed:
          type: boolean
          example: true
        obsolete:
          type: boolean
          example: false
        migration_state:
          type: object
          example:
            task_id: task_id
  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