Skip to content

Add V2 endpoint docs pages for datasets, monitors, notifiers, users #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6495ecc
Add V2 endpoints for datasets, monitors, notifiers, users
manototh Sep 4, 2024
6f4bb4d
Update V2 swagger file from axiom repo
manototh Sep 4, 2024
8725275
Fix examples
manototh Sep 4, 2024
1181efe
Fix update monitor
manototh Sep 4, 2024
f89eb49
Merge branch 'main' into mano/v2-endpoints
manototh Oct 30, 2024
f447e0a
Update mint.json
manototh Oct 30, 2024
f48cd57
Merge branch 'main' into mano/v2-endpoints
manototh Nov 4, 2024
ac974ff
Merge branch 'main' into mano/v2-endpoints
manototh Feb 11, 2025
1ba0f87
Add latest v2 swagger file
manototh Feb 11, 2025
b430faf
Merge from other PR
manototh Feb 11, 2025
12d53f6
Merge branch 'main' into mano/v2-endpoints
manototh Feb 11, 2025
8121c29
Update docs.json
manototh Feb 11, 2025
5a2d090
Merge branch 'main' into mano/v2-endpoints
manototh Feb 11, 2025
897af04
Merge branch 'main' into mano/v2-endpoints
manototh Apr 10, 2025
aab9f4f
Add latest V2 version
manototh Apr 10, 2025
32b7d26
Add latest version of all new endpoints
manototh Apr 10, 2025
b7deec0
TODO tokens pages
manototh Apr 10, 2025
b0d8fc4
Merge branch 'main' into mano/v2-endpoints
manototh Jun 26, 2025
83559c8
Remove ununsed endpoints
manototh Jun 26, 2025
58bddb2
Remove stuff
manototh Jun 26, 2025
3ce384f
Merge branch 'main' into mano/v2-endpoints
manototh Jul 2, 2025
8be3728
Fixes
manototh Jul 2, 2025
c990561
Sort out placeholders
manototh Jul 2, 2025
5cfba82
Fixes
manototh Jul 2, 2025
aff1d34
Update overview.mdx
manototh Jul 2, 2025
767489c
Merge branch 'main' into mano/v2-endpoints
manototh Jul 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,16 @@
"restapi/api-limits"
]
},
{
"group": "Manage resources",
"pages": [
"restapi/manage-resources/overview",
"restapi/manage-resources/manage-datasets",
"restapi/manage-resources/manage-monitors",
"restapi/manage-resources/manage-notifiers",
"restapi/manage-resources/manage-users"
]
},
{
"group": "Annotation endpoints",
"pages": [
Expand Down
181 changes: 181 additions & 0 deletions restapi/manage-resources/manage-datasets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
title: Manage datasets via API
sidebarTitle: "Datasets"
description: "Learn how to manage Axiom datasets via API."
---

import Prerequisites from "/snippets/minimal-prerequisites.mdx"
import ReplaceDomain from "/snippets/replace-domain.mdx"
import ReplaceToken from "/snippets/replace-token.mdx"

This page explains how to manage datasets programmatically via the API.

<Prerequisites />
- [Create an API token in Axiom](/reference/tokens) with permissions to create, read, update, and delete datasets.
- In the code samples below, replace `API_TOKEN` with the Axiom API token you have generated. For added security, store the API token in an environment variable.

## Create datasets

To create a dataset, send a POST request to the `datasets` endpoint. In the body of the request, specify the name and the description of the dataset. For example:

```bash
curl -X 'POST' 'https://AXIOM_DOMAIN/v2/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN' \
-d '{
"description": "This is a test dataset.",
"name": "test_dataset"
}'
```

<Info>
<ReplaceDomain />
<ReplaceToken />
</Info>

The example response contains the dataset ID that you can later use to access the dataset programmatically.

```json
{
"canWrite": true,
"created": "2025-07-02T09:40:53.327Z",
"description": "This is a test dataset.",
"id": "test_dataset",
"mapFields": null,
"name": "test_dataset",
"retentionDays": 0,
"useRetentionPeriod": false,
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/createDataset).

## Get information about datasets

### Get information about all datasets

To get information about all the datasets in your Axiom organization, send a GET request to the `datasets` endpoint. For example:

```bash
curl -X 'GET' 'https://AXIOM_DOMAIN/v2/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

<Info>
<ReplaceDomain />
<ReplaceToken />
</Info>

The example response is a list of dataset objects. Each object contains a unique dataset ID that you can later use to access the dataset programmatically.

```json
[
{
"canWrite": true,
"created": "2025-05-26T09:39:47.909Z",
"description": "This is a test dataset.",
"id": "test_dataset1",
"mapFields": null,
"name": "test_dataset1",
"retentionDays": 0,
"useRetentionPeriod": false,
"who": ""
},
{
"canWrite": true,
"created": "2025-07-02T09:40:53.327Z",
"description": "This is another test dataset.",
"id": "test_dataset2",
"mapFields": null,
"name": "test_dataset2",
"retentionDays": 0,
"useRetentionPeriod": false,
"who": ""
}
]
```

For more information, see the [API reference](/restapi/endpoints/getDatasets).

### Get information about specific dataset

To get information about a specific dataset, send a GET request to the `datasets/DATASET_ID` endpoint where `DATASET_ID` is the unique ID of the dataset. For example:

```bash
curl -X 'GET' 'https://AXIOM_DOMAIN/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

<Info>
<ReplaceDomain />
<ReplaceToken />
</Info>

Example response:

```json
{
"canWrite": true,
"created": "2025-07-02T09:40:53.327Z",
"description": "This is a test dataset.",
"id": "test_dataset",
"mapFields": null,
"name": "test_dataset",
"retentionDays": 0,
"useRetentionPeriod": false,
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/getDataset).

## Update datasets

To update a dataset, send a PUT request to the `datasets/DATASET_ID` endpoint where `DATASET_ID` is the unique ID of the dataset. In the body of the request, specify the properties you want to update. For example:

```bash
curl -X 'PUT' 'https://AXIOM_DOMAIN/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN' \
-d '{
"description": "This is a production dataset."
}'
```

<Info>
<ReplaceDomain />
<ReplaceToken />
</Info>

Example response:

```json
{
"canWrite": true,
"created": "2025-07-02T09:40:53.327Z",
"description": "This is a production dataset.",
"id": "test_dataset",
"mapFields": null,
"name": "test_dataset",
"retentionDays": 0,
"useRetentionPeriod": false,
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/updateDataset).

## Delete datasets

To delete a dataset, send a DELETE request to the `datasets/DATASET_ID` endpoint where `DATASET_ID` is the unique ID of the dataset. For example:

```bash
curl -X 'DELETE' 'https://AXIOM_DOMAIN/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

For more information, see the [API reference](/restapi/endpoints/deleteDataset).
Loading
Loading