Skip to content

Search on GitLab within a project

GET
/api/v4/projects/{id}/(-/)search

This feature was introduced in GitLab 10.5.

id
required
One of:
string

The ID or URL-encoded path of the project

search
required
string
nullable

The expression it should be searched for

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

The scope of the search

ref
string
nullable

The name of a repository branch or tag. If not given, the default branch is used

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.

fields
Array<string>
nullable

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

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

Not Found