Skip to content

Search an instance

GET
/api/v4/search

Searches for a term across the entire GitLab instance. The response depends on the requested scope.

search
required
string
nullable

The expression it should be searched for

scope
required
string
>= 1 characters
Allowed values: wiki_blobs blobs commits notes projects issues work_items merge_requests milestones snippet_titles users

The scope of the search

state
string
nullable
Allowed values: all opened closed merged

Filter results by state

confidential
boolean
nullable

Filter results by confidentiality

type
Array<string>
nullable

Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.

include_archived
boolean
nullable

Includes archived projects in the search. Introduced in GitLab 18.9.

fields
Array<string>
nullable

Array of fields you wish to search. Available with advanced search.

exclude_forks
boolean
nullable

Excludes forked projects in the search. Available with exact code search. Introduced in GitLab 18.9.

num_context_lines
integer
nullable <= 20

Number of context lines around each match. Available with advanced and exact code search. Introduced in GitLab 18.11.

regex
boolean
nullable

Performs a regex code search. Available with exact code search. Introduced in GitLab 18.9

page
integer
default: 1 nullable

Current page number

Example
1
per_page
integer
default: 20 nullable

Number of items per page

Example
20

OK

Bad Request