---
title: "Restore dataset to a previous version"
method: POST
path: "/v1/private/datasets/{id}/versions/restore"
tags: ["Datasets"]
---

# Restore dataset to a previous version

`POST /v1/private/datasets/{id}/versions/restore`

Restores the dataset to a previous version state by creating a new version with items copied from the specified version. If the version is already the latest, returns it as-is (no-op).

## Path parameters

- `id` string, uuid, required

## Request body

- DatasetVersionRestorePublic
  - `version_ref` string, required — Version hash or tag to restore from

## Response `200`

Version restored successfully

- DatasetVersionPublic
  - `id` string, uuid
  - `dataset_id` string, uuid
  - `version_hash` string
  - `tags` string[]
  - `is_latest` boolean — Indicates whether this is the latest version of the dataset
  - `version_name` string — Sequential version name formatted as 'v1', 'v2', etc.
  - `items_total` integer — Total number of items in this version
  - `items_added` integer — Number of items added since last version
  - `items_modified` integer — Number of items modified since last version
  - `items_deleted` integer — Number of items deleted since last version
  - `change_description` string
  - `metadata` object
  - `evaluators` EvaluatorItemPublic[] — Default evaluators for items in this version
    - `name` string, required
    - `type` 'llm_judge' | 'code_metric', required
    - `config` JsonNodePublic, required
  - `execution_policy` ExecutionPolicyPublic — Default execution policy for items in this version
    - `runs_per_item` integer
    - `pass_threshold` integer
  - `created_at` string, date-time
  - `created_by` string
  - `last_updated_at` string, date-time
  - `last_updated_by` string

## Other responses

- `404` — Version not found
- `409` — Concurrent modification - the latest version changed during the restore; retry

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/revisions/4ed2fbc97cc3/schema)
