Use this API to execute GitLab Query Language (GLQL) queries programmatically. GLQL provides a simplified query language to search and filter GitLab resources such as issues, merge requests, and epics across projects and groups.

The group or project must allow access to its data. For private groups and projects, you must authenticate with a personal access token that has the appropriate permissions.

Execute a GLQL query

POST /api/v4/glql

Executes a GLQL query to search and filter GitLab resources.

Request body (application/json)

PropertyTypeDescription
afterStringCursor for forward pagination. Use the endCursor from previous response to fetch the next page
glql_yaml
Required
StringThe full GLQL code block containing YAML configuration and query

Responses

CodeDescriptionSchema
200OKAPIEntitiesGlqlResult
400Bad request—
401Unauthorized—
403Forbidden—
429Too Many Requests—
500Internal server error—

Retrieve the GLQL schema

GET /api/v4/glql/schema

Retrieves the GLQL schema: data sources with their filter, display and sort fields, the operator, value kind and reference type vocabularies, the available functions, and the display types a query can be rendered as.

Responses

CodeDescriptionSchema
200OK—
500Internal server error—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesGlqlData

PropertyTypeDescription
countIntegerNumber of found items
Example: 42
nodesArray of arraysThe list of found items
Example: []
pageInfoAPIEntitiesGlqlPageInfoPagination information

APIEntitiesGlqlField

PropertyTypeDescription
fieldStringBase field name. For aliased parameterised fields this is the underlying field (for example, durationQuantile), while key is the alias (for example, p50). For standard fields, same as key
Example: title
keyStringUnique field key
Example: title
labelStringHuman-readable field label
Example: Title
nameStringUnderlying name of field, often the same as key, but it may be different if one type of field has multiple possible keys. Example created and createdAt
Example: title
parametersObjectResolved parameter metadata for parameterised fields, absent when the field has no parameters
Example: {"granularity":"weekly"}
typeStringField classification. Either dimension or metric for analytics mode fields, absent for standard fields
Example: dimension

APIEntitiesGlqlPageInfo

PropertyTypeDescription
endCursorStringCursor for the last item
Example: eyJpZCI6IjE3In0
hasNextPageBooleanWhether there are more items
Example: true
hasPreviousPageBooleanWhether there are previous items
Example: false
startCursorStringCursor for the first item
Example: eyJpZCI6IjE3In0

APIEntitiesGlqlResult

PropertyTypeDescription
dataAPIEntitiesGlqlDataQuery result data containing count, nodes, and pagination info
errorStringError message if query failed
fieldsArray of APIEntitiesGlqlFieldField definitions for the query results
successBooleanExample: true