For the complete documentation index, see llms.txt. This page is also available as Markdown.

Queries

Use these operations to interact with CQL queries in Cortex.

Required permissions

Edit entities: Your API key must have the Enable Query builder permission.

Operations

Retrieve query results

get

Retrieve the status and results of a CQL query

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
jobIdstringRequired

jobId of the query to retrieve

Responses
200

Successfully found query

application/json
progressnumberOptional
statusstring · enumRequiredPossible values:
get/api/v1/queries/{jobId}
GET /api/v1/queries/{jobId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "progress": 1,
  "queryDetails": {
    "initiatedAt": "2026-01-01T00:00:00.000Z",
    "jobId": "text",
    "query": "text"
  },
  "result": [
    {
      "description": "text",
      "name": "text",
      "tag": "text",
      "type": "text"
    }
  ],
  "status": "IN_PROGRESS"
}

Run query

post

Run a CQL query. For more information about the types of queries you can run, take a look at our CQL Explorer in the app.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Body
querystringRequired
Responses
200

Successfully submitted query

application/json
initiatedAtstring · date-timeRequired
jobIdstringRequired

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

querystringRequired
post/api/v1/queries
POST /api/v1/queries HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "query": "text"
}
{
  "initiatedAt": "2026-01-01T00:00:00.000Z",
  "jobId": "text",
  "query": "text"
}

Last updated

Was this helpful?