---
title: "Execute a GLQL query"
method: POST
path: "/api/v4/glql"
tags: ["glql"]
---

# Execute a GLQL query

`POST /api/v4/glql`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/glql`
- Auth: none declared

Executes a GLQL query to search and filter GitLab resources.

## Request body

- PostApiV4Glql: Execute a GLQL query
  - `glql_yaml` string, required: The full GLQL code block containing YAML configuration and query
  - `after` string: Cursor for forward pagination. Use the `endCursor` from previous response to fetch the next page

## Response `200`

Execute a GLQL query

- APIEntitiesGlqlResult: API_Entities_Glql_Result model
  - `data` APIEntitiesGlqlData, required
    - `count` integer, required: Number of found items
    - `nodes` array[], required: The list of found items
      - unknown[]
        - unknown
    - `pageInfo` APIEntitiesGlqlPageInfo, required
      - `endCursor` string, required: Cursor for the last item
      - `hasNextPage` boolean, required: Whether there are more items
      - `hasPreviousPage` boolean, required: Whether there are previous items
      - `startCursor` string, required: Cursor for the first item
  - `error` string, required: Error message if query failed
  - `fields` APIEntitiesGlqlField[], required: Field definitions for the query results
    - `key` string, required: Unique field key
    - `label` string, required: Human-readable field label
    - `name` string, required: Underlying 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`
  - `success` boolean, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests
- `500`: Internal server error
- `503`: Service unavailable

## Changes

- **2026-11-04** `b234947ef3f2`: 1 info
  - added the non-success response with the status `503`

[Operation history](https://skmtc.dev/gitlab/apis/gitlab-api/changes/api/v4/glql/post.md)

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
