---
title: "Restore dataset"
method: POST
path: "/v1/dataset/{dataset_id}/restore"
tags: ["Datasets"]
---

# Restore dataset

`POST /v1/dataset/{dataset_id}/restore`

## Request

- Base URL: `https://api.braintrust.dev`
- URL: `https://api.braintrust.dev/v1/dataset/{dataset_id}/restore`
- Auth: one of:
  - HTTP bearer
  - none

Restore a dataset to an earlier version, such as a dataset snapshot. Rows changed since that version are reverted, and rows created since then are deleted. The restore is recorded as a new transaction, so dataset history is preserved. Fails if more than 20,000 rows changed since the requested version. Requires update permission on the dataset.

## Path parameters

- `dataset_id` string, uuid, required: Dataset id

## Request body

- DatasetRestoreRequest
  - `version` string, required: The dataset version to restore to, such as the `xact_id` of a dataset snapshot

## Response `200`

Number of rows the restore changed

- DatasetRestoreResponse
  - `xact_id` string, nullable, required: Transaction id of the restore, or null if the restore made no changes
  - `rows_restored` integer, required: Number of rows restored to their value at the requested version
  - `rows_deleted` integer, required: Number of rows created after the requested version that were deleted

## Other responses

- `400`: The request was unacceptable, often due to missing a required parameter
- `401`: No valid API key provided
- `403`: The API key doesn’t have permissions to perform the request
- `429`: Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
- `500`: Something went wrong on Braintrust's end. (These are rare.)

## Changes

- **2026-10-30** `01a2a9298945`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/braintrustdata/apis/braintrust-api/changes/v1/dataset/:dataset_id/restore/post.md)

---

[API](https://skmtc.dev/braintrustdata/apis/braintrust-api.md) - [All operations](https://skmtc.dev/braintrustdata/apis/braintrust-api/llms.txt) - [OpenAPI document](https://skmtc.dev/braintrustdata/apis/braintrust-api/revisions/19184ec94018?raw)
