Datasets API

This API allows you to create a dataset, list and delete datasets.

Creating an Access Token

Access Tokens can be your API or Personal Tokens managed inside your account setings.

API Token

API Tokens allow access to datasets for either querying data, ingesting data, or both. In your settings menu click on API Tokens and create your API Token

API Token overview

Personal Token

Personal tokens allows you to access the Axiom API programmatically for custom integrations. In your settings menu, click on Profile and select Personal Token.

Personal Token overview

Get Datasets

GET /api/v1/datasets

All Datasets for your team may be retrieved by sending a GET request to /api/v1/datasets

Example Request

curl -X 'GET' \
'https://cloud.axiom.co/api/v1/datasets' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response

Response status should be 200, and the response body

[
{
"created": "2021-10-19T16:18:57.746Z",
"description": "string",
"id": "string",
"name": "string",
"who": "string"
}
]

Post Dataset

POST /api/v1/datasets

Datasets are created by sending a POST request to /api/v1/datasets

The body should be a JSON encoded object containing a name.

Response status should be 200, and the body.

Example Request

curl -X 'POST' \
'https://cloud.axiom.co/api/v1/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>' \
-d '{
"description": "string",
"name": "string"
}'

Example Response

{
"created": "2021-10-19T19:43:06.068Z",
"description": "string",
"id": "string",
"name": "string",
"who": "string"
}

Post /datasets/_apl

POST /api/v1/datasets/_apl?format=legacy&nocache=true

Example Request

curl -X 'POST' \
'https://cloud.axiom.co/api/v1/datasets/_apl?format=legacy&nocache=true' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>' \
-d '{
"apl": "string",
"datasetMap": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"endTime": "2021-10-19T19:44:21.465Z",
"queryOptions": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"startTime": "2021-10-19T19:44:21.465Z"
}'

Example Response

Response samples with code 200 and the body

{
"buckets": {
"series": [
{
"endTime": "2021-10-20T09:09:49.558Z",
"groups": [
{
"aggregations": [
{
"op": "string",
"value": {}
}
],
"group": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"id": 0
}
],
"startTime": "2021-10-20T09:09:49.558Z"
}
],
"totals": [
{
"aggregations": [
{
"op": "string",
"value": {}
}
],
"group": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"id": 0
}
]
},
"matches": [
{
"_rowId": "string",
"_sysTime": "2021-10-20T09:09:49.558Z",
"_time": "2021-10-20T09:09:49.558Z",
"data": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}
}
],
"request": {
"aggregations": [
{
"alias": "string",
"argument": {},
"field": "string",
"op": "count"
}
],
"continuationToken": "string",
"cursor": "string",
"endTime": "2021-10-20T09:09:49.558Z",
"filter": {
"caseSensitive": true,
"children": [
"string"
],
"field": "string",
"op": "and",
"value": {}
},
"groupBy": [
"string"
],
"includeCursor": true,
"limit": 0,
"order": [
{
"desc": true,
"field": "string"
}
],
"project": [
{
"alias": "string",
"field": "string"
}
],
"resolution": "string",
"startTime": "2021-10-20T09:09:49.558Z",
"virtualFields": [
{
"alias": "string",
"expr": "string"
}
]
},
"status": {
"blocksExamined": 0,
"cacheStatus": 0,
"continuationToken": "string",
"elapsedTime": 0,
"isEstimate": true,
"isPartial": true,
"maxBlockTime": "2021-10-20T09:09:49.558Z",
"messages": [
{
"code": "string",
"count": 0,
"msg": "string",
"priority": "string"
}
],
"minBlockTime": "2021-10-20T09:09:49.558Z",
"numGroups": 0,
"rowsExamined": 0,
"rowsMatched": 0
}
}

GET /datasets/_history/{id}

GET /api/v1/datasets/_history/<dataset_history_id>

Example Request

curl -X 'GET' \
'https://cloud.axiom.co/api/v1/datasets/_history/<dataset_history_id>' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>'
-H 'X-Axiom-Org-ID: <$ORG_ID>' \

Example Response

Response samples with code 200 and the body

{
"created": "2021-10-20T10:58:05.003Z",
"dataset": "string",
"id": "string",
"kind": "analytics",
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"name": "string",
"query": {},
"who": "string"
}

GET /datasets/_info

GET /api/v1/datasets/_info

Example Request

curl -X 'GET' \
'https://cloud.axiom.co/api/v1/datasets/_info' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>'
-H 'X-Axiom-Org-ID: <$ORG_ID>' \

Example Response

Response samples with code 200 and the body

[
{
"compressedBytes": 0,
"compressedBytesHuman": "string",
"created": "2021-10-20T11:02:16.814Z",
"fields": [
{
"description": "string",
"hidden": true,
"name": "string",
"type": "string",
"unit": "string"
}
],
"inputBytes": 0,
"inputBytesHuman": "string",
"maxTime": "2021-10-20T11:02:16.814Z",
"minTime": "2021-10-20T11:02:16.814Z",
"name": "string",
"numBlocks": 0,
"numEvents": 0,
"numFields": 0,
"who": "string"
}
]

GET /datasets/_stats

GET /api/v1/datasets/_stats

Example Request

curl -X 'GET' \
'https://cloud.axiom.co/api/v1/datasets/_stats' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>'
-H 'X-Axiom-Org-ID: <$ORG_ID>' \

Example Response

Response samples with code 200 and the body

{
"compressedBytes": 0,
"compressedBytesHuman": "string",
"datasets": [
{
"compressedBytes": 0,
"compressedBytesHuman": "string",
"created": "2021-10-20T11:05:21.134Z",
"fields": [
{
"name": "string",
"type": "string"
}
],
"inputBytes": 0,
"inputBytesHuman": "string",
"maxTime": "2021-10-20T11:05:21.134Z",
"minTime": "2021-10-20T11:05:21.134Z",
"name": "string",
"numBlocks": 0,
"numEvents": 0,
"numFields": 0
}
],
"inputBytes": 0,
"inputBytesHuman": "string",
"numBlocks": 0,
"numEvents": 0
}

DELETE /datasets/{id}

DELETE /api/v1/datasets/<dataset_id>

Example Request

curl -X 'DELETE' \
'https://cloud.axiom.co/api/v1/datasets/<dataset_id>' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response

A successful response will have status code 204 and an empty body.

GET /datasets/{id}

GET /api/v1/datasets/<dataset_id>

Example Request

curl -X 'GET' \
'https://cloud.axiom.co/api/v1/datasets/<dataset_id>' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response

Response samples with code 200 and body.

{
"created": "2021-10-20T12:06:05.863Z",
"description": "string",
"id": "string",
"name": "string",
"who": "string"
}

PUT /datasets/{id}

PUT /api/v1/datasets/<dataset_id>

Example Request

curl -X 'PUT' \
'https://cloud.axiom.co/api/v1/datasets/<dataset_id>' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>' \
-d '{
"description": "string"
}'

Example Response

The API returns code 200 and the updated datasets as the body of the response

{
"created": "2021-10-20T12:18:27.441Z",
"description": "string",
"id": "string",
"name": "string",
"who": "string"
}

PUT /datasets/{id}/fields/{fieldId}

PUT /api/v1/datasets/<dataset_id>/fields/<dataset_field_id>

Example Request

curl -X 'PUT' \
'https://cloud.axiom.co/api/v1/datasets/<dataset_id>/fields/<dataset_field_id>' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>' \
-d '{
"description": "string",
"hidden": true,
"name": "string",
"type": "string",
"unit": "string"
}

Example Response

The API returns code 200 and the updated datasets as the body of the response

{
"description": "string",
"hidden": true,
"name": "string",
"type": "string",
"unit": "string"
}

GET /datasets/{id}/info

GET /api/v1/datasets/<dataset_id>/info

Example Request

curl -X 'GET' \
'https://cloud.axiom.co/api/v1/datasets/<dataset_id>/info' \
-H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response

{
"compressedBytes": 0,
"compressedBytesHuman": "string",
"created": "2021-10-20T12:26:49.470Z",
"fields": [
{
"description": "string",
"hidden": true,
"name": "string",
"type": "string",
"unit": "string"
}
],
"inputBytes": 0,
"inputBytesHuman": "string",
"maxTime": "2021-10-20T12:26:49.470Z",
"minTime": "2021-10-20T12:26:49.470Z",
"name": "string",
"numBlocks": 0,
"numEvents": 0,
"numFields": 0,
"who": "string"
}

POST /datasets/{id}/query

POST /api/v1/datasets/id/query?saveAsKind=<save_as_kind_quer>&streaming-duration=<streaming_duration>&nocache=<true/false>

Example Request

curl -X 'POST' \
'https://cloud.axiom.co/api/v1/datasets/id/query?saveAsKind=<save_as_kind_query>&streaming-duration=<streaming_duration>&nocache=true' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>' \
-d '{
"aggregations": [
{
"alias": "string",
"argument": {},
"field": "string",
"op": "count"
}
],
"continuationToken": "string",
"cursor": "string",
"endTime": "2021-10-20T12:29:41.296Z",
"filter": {
"caseSensitive": true,
"children": [
"string"
],
"field": "string",
"op": "and",
"value": {}
},
"groupBy": [
"string"
],
"includeCursor": true,
"limit": 0,
"order": [
{
"desc": true,
"field": "string"
}
],
"project": [
{
"alias": "string",
"field": "string"
}
],
"queryOptions": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"resolution": "string",
"startTime": "2021-10-20T12:29:41.296Z",
"virtualFields": [
{
"alias": "string",
"expr": "string"
}
]
}'

Example Response

Response sample code 200 and the body.

{
"buckets": {
"series": [
{
"endTime": "2021-10-20T12:30:14.020Z",
"groups": [
{
"aggregations": [
{
"op": "string",
"value": {}
}
],
"group": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"id": 0
}
],
"startTime": "2021-10-20T12:30:14.020Z"
}
],
"totals": [
{
"aggregations": [
{
"op": "string",
"value": {}
}
],
"group": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"id": 0
}
]
},
"matches": [
{
"_rowId": "string",
"_sysTime": "2021-10-20T12:30:14.020Z",
"_time": "2021-10-20T12:30:14.020Z",
"data": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}
}
],
"status": {
"blocksExamined": 0,
"cacheStatus": 0,
"continuationToken": "string",
"elapsedTime": 0,
"isEstimate": true,
"isPartial": true,
"maxBlockTime": "2021-10-20T12:30:14.020Z",
"messages": [
{
"code": "string",
"count": 0,
"msg": "string",
"priority": "string"
}
],
"minBlockTime": "2021-10-20T12:30:14.020Z",
"numGroups": 0,
"rowsExamined": 0,
"rowsMatched": 0
}
}

POST /datasets/{id}/trim

POST /api/v1/datasets/<dataset_id>/trim

Example Request

curl -X 'POST' \
'https://cloud.axiom.co/api/v1/datasets/<dataset_id>/trim' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
-H 'X-Axiom-Org-ID: <$ORG_ID>'
-d '{
"maxDuration": "string"
}'

Example Response

Response sample code 200 and the body.

{
"numDeleted": 0
}