Queries

Run a CQL query against up to 100 entities, or against one page of the catalog with pageSize and pageToken. A request with neither runs against every entity in the catalog. Starting November 10, 2026, it runs against the first page only, and the response's nextPageToken reads the next page. For more information about the types of queries you can run, take a look at our CQL Explorer in the app.

post/api/v1/queries

Request

  • Base URL
    https://api.getcortexapp.com
  • URL
    https://api.getcortexapp.com/api/v1/queries
  • Auth
    HTTP bearer

Request body

entitiesstring[]

Tags or Cortex IDs of the entities to run the query against, from 1 to 100. Omit to page through the catalog with pageSize and pageToken instead.

pageSizeinteger

Run the query against one page of at most this many entities, at most 1000. The response's nextPageToken reads the next page. Defaults to 1000 when pageToken is set.

pageTokenstring

The nextPageToken from the previous response, to run the query against the next page.

querystring required

Example request

{
  "entities": [
    "my-service"
  ],
  "pageSize": 1000
}

Response

Successfully submitted query

initiatedAtstring date-time required
jobIdstring required

Id that can be used to request the status of the query. If you would like to re-run the query, you must re-run the query in the UI. See retrieve query results

nextPageTokenstring

Pass as pageToken to run the same query against the next page. Absent on the last page, and when the request did not page.

querystring required

Changes