Skip to main content
POST
/
api
/
analytics
/
query
Execute analytics query
curl --request POST \
  --url https://platform.kodexa.ai/api/analytics/query \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "dataset": "<string>",
  "organizationId": "<string>",
  "filters": [
    {
      "field": "<string>",
      "operator": "<string>",
      "value": {},
      "values": [
        {}
      ]
    }
  ],
  "groupBy": [
    "<string>"
  ],
  "limit": 123,
  "metrics": [
    "<string>"
  ],
  "offset": 123,
  "projectId": "<string>",
  "sort": [
    {
      "direction": "asc",
      "field": "<string>"
    }
  ],
  "timeRange": {
    "field": "<string>",
    "from": "<string>",
    "to": "<string>"
  }
}
'
{
  "columns": [
    "<string>"
  ],
  "dataset": "<string>",
  "rowCount": 123,
  "rows": [
    {}
  ]
}

Authorizations

x-api-key
string
header
required

API key for authentication. Create one from the Kodexa platform UI under Settings > Access Tokens.

Body

application/json

Request body for dataset-driven analytics queries.

dataset
string
required

Dataset key returned by /api/analytics/datasets.

organizationId
string
required

Organization scope for the query.

filters
object[]
groupBy
string[]
limit
integer<int32>
metrics
string[]
offset
integer<int32>
projectId
string

Optional project scope when supported by the dataset.

sort
object[]
timeRange
object

Time bounds for analytics filtering.

Response

Analytics query result

Tabular result of an analytics query.

columns
string[]
dataset
string
rowCount
integer<int32>
rows
object[]