---
title: "POST /datasets/{dataset_id}/vacuum"
method: POST
path: "/datasets/{dataset_id}/vacuum"
tags: ["datasets"]
---

# POST /datasets/{dataset_id}/vacuum

`POST /datasets/{dataset_id}/vacuum`

## Request

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

Queues a job that rebuilds the field schema of a dataset from its stored events, removing fields that no longer occur in any event. Doesn't delete events. You can vacuum each dataset once per hour.

## Path parameters

- `dataset_id` string, required

## Response `200`

Vacuum job queued.

- JobCreateResponse
  - `jobID` string, required

## Other responses

- `400`: The dataset is a metrics dataset.
- `403`: Forbidden
- `404`: Not found
- `429`: The dataset was vacuumed less than an hour ago. Retry after the time in `Retry-After`.

## Changes

- **2026-10-16** (v2) `fbc1b8430feb`: 3 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
- **2026-10-14** (v2) `8920e1697284`: 1 info
  - added the media type `application/json` for the response with the status `200`

[Operation history](https://skmtc.dev/axiom/apis/axiom-public-api/changes/datasets/:dataset_id/vacuum/post.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)
