Search a project
GET
/api/v4/projects/{id}/(-/)search
Searches for content in a specified project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”search
required
string
The expression it should be searched for
scope
required
string
The scope of the search
ref
string
The name of a repository branch or tag. If not given, the default branch is used
state
string
Filter results by state
confidential
boolean
Filter results by confidentiality
type
Array<string>
Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.
fields
Array<string>
Array of fields you wish to search. Available with advanced search.
num_context_lines
integer
Number of context lines around each match. Available with advanced and exact code search. Introduced in GitLab 18.11.
regex
boolean
Performs a regex code search. Available with exact code search. Introduced in GitLab 18.9
page
integer
Current page number
Example
1per_page
integer
Number of items per page
Example
20Responses
Section titled “Responses”OK
Bad Request
Not Found