Datasets API

Use Axiom datasets API to create, list, and delete datasets. A Dataset consists of a name, id, description, and the specific time it was created.

Get Datasets

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

Request Example:

GET api.axiom.co/v1/datasets

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

Response Example:

Response code 200 and the response body:

[
  {
    "created": "2022-07-26T02:07:46.349Z",
    "description": "string",
    "id": "string",
    "integrationConfigs": ["string"],
    "name": "string",
    "who": "string"
  }
]

Post Dataset

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

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

Request Example:

POST api.axiom.co/v1/datasets

curl -X 'POST' \
  'https://api.axiom.co/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"
}'

Response Example:

Response code 200 and the response body:

{
  "created": "2022-07-20T02:35:14.137Z",
  "description": "string",
  "id": "string",
  "integrationConfigs": ["string"],
  "name": "string",
  "who": "string"
}

Post /datasets/_apl

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

Request Example:

curl -X 'POST' \
  'https://api.axiom.co/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",
  "endTime": "string",
  "queryOptions": {
    "against": "string",
    "againstStart": "string",
    "againstTimestamp": "string",
    "caseSensitive": "string",
    "containsTimeFilter": "string",
    "datasets": "string",
    "displayNull": "string",
    "editorContent": "string",
    "endColumn": "string",
    "endLineNumber": "string",
    "endTime": "string",
    "integrationsFilter": "string",
    "openIntervals": "string",
    "quickRange": "string",
    "resolution": "string",
    "startColumn": "string",
    "startLineNumber": "string",
    "startTime": "string",
    "timeSeriesView": "string"
  },
  "startTime": "string"
}'

Response Example:

Response code 200 and the response body:

{
  "buckets": {
    "series": [
      {
        "endTime": "2022-07-26T02:48:46.931Z",
        "groups": [
          {
            "aggregations": [
              {
                "op": "string",
                "value": {}
              }
            ],
            "group": {
              "additionalProp1": {},
              "additionalProp2": {},
              "additionalProp3": {}
            },
            "id": 0
          }
        ],
        "startTime": "2022-07-26T02:48:46.931Z"
      }
    ],
    "totals": [
      {
        "aggregations": [
          {
            "op": "string",
            "value": {}
          }
        ],
        "group": {
          "additionalProp1": {},
          "additionalProp2": {},
          "additionalProp3": {}
        },
        "id": 0
      }
    ]
  },
  "datasetNames": ["string"],
  "fieldsMetaMap": {
    "additionalProp1": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ],
    "additionalProp2": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ],
    "additionalProp3": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ]
  },
  "matches": [
    {
      "_rowId": "string",
      "_sysTime": "2022-07-26T02:48:46.931Z",
      "_time": "2022-07-26T02:48:46.931Z",
      "data": {
        "additionalProp1": {},
        "additionalProp2": {},
        "additionalProp3": {}
      }
    }
  ],
  "request": {
    "aggregations": [
      {
        "alias": "string",
        "argument": {},
        "field": "string",
        "op": "count"
      }
    ],
    "continuationToken": "string",
    "cursor": "string",
    "endTime": "string",
    "fieldsMeta": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ],
    "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": "string",
    "virtualFields": [
      {
        "alias": "string",
        "expr": "string"
      }
    ]
  },
  "status": {
    "blocksExamined": 0,
    "cacheStatus": 0,
    "continuationToken": "string",
    "elapsedTime": 0,
    "isEstimate": true,
    "isPartial": true,
    "maxBlockTime": "2022-07-26T02:48:46.931Z",
    "messages": [
      {
        "code": "string",
        "count": 0,
        "msg": "string",
        "priority": "string"
      }
    ],
    "minBlockTime": "2022-07-26T02:48:46.931Z",
    "numGroups": 0,
    "rowsExamined": 0,
    "rowsMatched": 0
  }
}

DELETE /datasets/id

DELETE api.axiom.co/v1/datasets/<dataset_id>

Request Example:

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

Response Example:

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

GET /datasets/id

GET api.axiom.co/v1/datasets/<dataset_id>

Request Example:

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

Response Example:

Response code 200 and the response body:

{
  "created": "2022-07-26T02:56:59.464Z",
  "description": "string",
  "id": "string",
  "integrationConfigs": ["string"],
  "name": "string",
  "who": "string"
}

PUT /datasets/id

PUT api.axiom.co/v1/datasets/<dataset_id>

Request Example:

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

Response Example:

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

{
  "created": "2022-07-26T02:58:22.585Z",
  "description": "string",
  "id": "string",
  "integrationConfigs": ["string"],
  "name": "string",
  "who": "string"
}

POST /datasets/id/trim

POST api.axiom.co/v1/datasets/<dataset_id>/trim

Request Example:

curl -X 'POST' \
  'https://api.axiom.co/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"
}'

Response Example:

Response code 200 and the response body:

{
  "numDeleted": 0
}

Was this page helpful?