Overview

Run query (legacy)

Query (Legacy)

POST/v1/datasets/{dataset_name}/query
Features

Send the token in the Authorization: Bearer API_TOKEN header. See Tokens for which token types this endpoint accepts.

Input18
Authorizationheaderrequired
Sent from your browser straight to the API — never to Docsbook, never stored.
dataset_namestring · pathrequired
(path) Unique name of the dataset.
saveAsKindstring · body
(query)
streaming-durationstring · body
(query)
nocacheboolean · body
(query)
aggregationsobject[] · body
Show child attributes4
aliasstring
argumentobject
fieldstringrequired
opstringrequired
One of: count, distinct, sum, avg, min, max, topk, percentiles, histogram, stdev, variance, argmin, argmax, makeset, rate, makelist.
continuationTokenstring · body
cursorstring · body
A cursor for use in pagination. Use the cursor string returned in previous responses to fetch the next or previous page of results.
endTimestring · bodyrequired
filterobject · body
Show child attributes5
caseSensitiveboolean
Supported for these filters: starts-with, not-starts-with, ends-with, not-ends-with, contains, not-contains, eq, ne.
childrenstring[]
Supported for these filters: and, or, not.
fieldstringrequired
opstringrequired
We also support '==', but we’re not exporting that to swagger, because it can’t deal with it add >, >=, <, <= to that list, it breaks codegen. One of: and, or, not, eq, !=, ne, exists, not-exists, gt, gte, lt, lte, starts-with, not-starts-with, ends-with, not-ends-with, contains, not-contains, regexp, not-regexp.
valueobject
groupBystring[] · body
includeCursorboolean · body
Specifies whether to include the row identified by the cursor in the results. Default is false.
limitinteger · body
Specifies the maximum number of events to return. Default is 1000, minimum is 0, maximum is 50000.
orderobject[] · body
Show child attributes2
descbooleanrequired
fieldstringrequired
projectobject[] · body
Show child attributes2
aliasstring
fieldstringrequired
queryOptionsobject · body
Show child attributes22
againststring
againstStartstring
againstTimestampstring
aggChartOptsstring
caseSensitivestring
containsTimeFilterstring
datasetsstring
displayNullstring
editorContentstring
endColumnstring
endLineNumberstring
endTimestring
integrationsFilterstring
openIntervalsstring
quickRangestring
resolutionstring
shownColumnsstring
startColumnstring
startLineNumberstring
startTimestring
timeSeriesVariantstring
timeSeriesViewstring
resolutionstring · bodyrequired
The time resolution of the query’s graph, in seconds. Valid values are the query’s time range /100 at maximum and /1000 at minimum or "auto".
startTimestring · bodyrequired
start and end time for the query, these must be specified as RFC3339 strings or using relative time expressions (e.g. now-1h, now-1d, now-1w, etc)
virtualFieldsobject[] · body
Show child attributes2
aliasstringrequired
exprstringrequired
Output6
bucketsobject
fieldsMetaobject[]
FieldsMeta contains the unit information (if we have it) for each field
formatstring
Format specifies the result set format. Either "legacy" (default) or "tabular".
matchesobject[]
Matches hold the matching events of a filter query in the "legacy" result format
statusobject
tablesobject[]
Tables hold the result tables in the "tabular" result format
Responses
200Result
403Forbidden
Example input
curl -X POST 'https://api.axiom.co/v1/datasets/{dataset_name}/query' \
  -H 'Authorization: Bearer API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"endTime":"string","resolution":"string","startTime":"string"}'
Example output
{
  "buckets": {
    "series": [
      {
        "endTime": "2022-07-26T03:00:48.925Z",
        "groups": [
          {
            "aggregations": [
              {
                "op": "string",
                "value": {}
              }
            ],
            "group": {
              "additionalProp1": {},
              "additionalProp2": {},
              "additionalProp3": {}
            },
            "id": 0
          }
        ],
        "startTime": "2022-07-26T03:00:48.925Z"
      }
    ],
    "totals": [
      {
        "aggregations": [
          {
            "op": "string",
            "value": {}
          }
        ],
        "group": {
          "additionalProp1": {},
          "additionalProp2": {},
          "additionalProp3": {}
        },
        "id": 0
      }
    ]
  },
  "fieldsMeta": [
    {
      "description": "string",
      "hidden": true,
      "name": "string",
      "type": "string",
      "unit": "string"
    }
  ],
  "matches": [
    {
      "_rowId": "string",
      "_sysTime": "2022-07-26T03:00:48.925Z",
      "_time": "2022-07-26T03:00:48.925Z",
      "data": {
        "additionalProp1": {},
        "additionalProp2": {},
        "additionalProp3": {}
      }
    }
  ],
  "status": {
    "blocksExamined": 0,
    "cacheStatus": 0,
    "continuationToken": "string",
    "elapsedTime": 0,
    "isEstimate": true,
    "isPartial": true,
    "maxBlockTime": "2022-07-26T03:00:48.925Z",
    "messages": [
      {
        "code": "string",
        "count": 0,
        "msg": "string",
        "priority": "string"
      }
    ],
    "minBlockTime": "2022-07-26T03:00:48.925Z",
    "numGroups": 0,
    "rowsExamined": 0,
    "rowsMatched": 0
  }
}

Updated

Was this page helpful?