---
title: "Update dataset"
method: PUT
path: "/datasets/{dataset_id}"
tags: ["Datasets"]
---

# Update dataset

`PUT /datasets/{dataset_id}`

## Request

- Base URL: `https://api.axiom.co/v2`
- URL: `https://api.axiom.co/v2/datasets/{dataset_id}`
- Auth: OAuth 2
  - Authorization code: `https://accounts.google.com/o/oauth2/v2/auth`
  - Token URL: `https://www.googleapis.com/oauth2/v4/token` scopes: `datasets|update`
- TypeScript: <https://skmtc.dev/axiom/apis/axiom-public-api/docs/datasets/:dataset_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates the `description` and `retentionDays` of a dataset. Both values are replaced, so omitting `description` clears it, and omitting `retentionDays` or setting it to `0` applies your plan's default retention. `labelIds` replaces assignments when supplied; [] clears them. Omitted or null `labelIds` preserves assignments on updates and creates an unlabeled resource on creation. IDs must belong to existing labels in your organization and are validated before saving.

## Path parameters

- `dataset_id` string, required

## Request body

- UpdateDataset
  - `description` string
  - `labelIds` LabelID[]: Existing label IDs; replaces assignments when supplied, clears with [], and preserves them when omitted or null.
  - `retentionDays` integer: Number of days to retain data in the dataset
  - `useRetentionPeriod` boolean: Ignored. Axiom derives this value from `retentionDays`.

## Response `200`

Updated dataset.

- Dataset
  - `canWrite` boolean: Whether this dataset has write access
  - `created` string, date-time, required: The RFC3339-formatted time when the dataset was created.
  - `createdByAgent` boolean: true when the MCP server created this dataset
  - `description` string, required: Dataset description
  - `edgeDeployment` string: Edge deployment of the dataset
  - `edgeDeploymentUrl` string: URL of the edge deployment
  - `id` string, required: Dataset ID
  - `kind` 'otel:metrics:v1' | 'otel:traces:v1' | 'otel:logs:v1' | 'axiom:events:v1', required: The kind of the dataset
  - `labelIds` LabelID[], required: IDs of labels assigned to this dataset.
  - `labelNames` string[], required: Names of assigned labels, including with exclude=labels; [] when unassigned.
  - `labels` Label[]: Resolved labels assigned to this dataset.
    - `color` LabelColor, required
      - `name` 'red' | 'coral' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'blue' | 'iris' | 'purple' | 'pink', required
      - `type` 'palette', required
    - `description` string, nullable
    - `id` string, required
    - `name` string, required
  - `mapFields` string[]
  - `name` string, required: Unique dataset name
  - `reclaimableFields` integer: Number of unused fields a vacuum can reclaim, when the dataset is a vacuum candidate
  - `retentionDays` integer: Number of days to retain data in the dataset
  - `sharedByOrg` string: ID of the org that shared this resource, if it's shared
  - `updatedAt` string, date-time, required: The RFC3339-formatted time when the dataset was last updated.
  - `useRetentionPeriod` boolean: Whether to use the retention period
  - `vacuumCandidate` boolean: Whether the dataset has unused fields that a vacuum can reclaim
  - `who` string, required: Name of the dataset creator

## Other responses

- `400`: Bad request
- `403`: Forbidden
- `404`: Not found

## Changes

- **2026-11-02** (v2) `e3baf3b85e8d`: 3 info
  - added the new optional request property `labelIds`
  - added the optional property `createdByAgent` to the response with the `200` status
  - added the required property `labelNames` to the response with the `200` status
- **2026-10-16** (v2) `fbc1b8430feb`: 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `404`
- **2026-10-14** (v2) `8920e1697284`: 4 info
  - added the optional property `labels` to the response with the `200` status
  - added the optional property `reclaimableFields` to the response with the `200` status
  - added the optional property `vacuumCandidate` to the response with the `200` status
  - added the required property `labelIds` to the response with the `200` status

[Operation history](https://skmtc.dev/axiom/apis/axiom-public-api/changes/datasets/:dataset_id/put.md)

---

[API](https://skmtc.dev/axiom/apis/axiom-public-api.md) - [All operations](https://skmtc.dev/axiom/apis/axiom-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/axiom/apis/axiom-public-api/revisions/7e39a295e3ba?raw)
