Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Restore dataset to a previous version

POST/v1/private/datasets/{id}/versions/restoreRestore dataset to a previous version

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).

Parameters

idstring · uuidpathrequired

Request body

application/json
objectDatasetVersionRestore_Public
version_refstringrequired

Version hash or tag to restore from

minLength 1

Example request
{
  "version_ref": "string"
}

Responses

200Version restored successfullyapplication/json
objectDatasetVersion_Public
change_descriptionstring
created_atstring · date-time
created_bystring
dataset_idstring · uuid
evaluatorsarray of object

Default evaluators for items in this version

Show child attributes
Show array items

Default evaluators for items in this version

configobjectrequired
namestringrequired

minLength 1

typestringrequired

one of "llm_judge", "code_metric"

execution_policyobject

Default execution policy for items in this version

Show child attributes
pass_thresholdinteger · int32

maximum 100 · minimum 1

runs_per_iteminteger · int32

maximum 100 · minimum 1

idstring · uuid
is_latestboolean

Indicates whether this is the latest version of the dataset

items_addedinteger · int32

Number of items added since last version

items_deletedinteger · int32

Number of items deleted since last version

items_modifiedinteger · int32

Number of items modified since last version

items_totalinteger · int32

Total number of items in this version

last_updated_atstring · date-time
last_updated_bystring
metadataobject
tagsarray of string

uniqueItems true

Show child attributes

uniqueItems true

version_hashstring
version_namestring

Sequential version name formatted as 'v1', 'v2', etc.

Example response
{
  "change_description": "string",
  "created_at": "2026-06-09T00:00:00Z",
  "created_by": "string",
  "dataset_id": "00000000-0000-0000-0000-000000000000",
  "evaluators": [
    {
      "config": {},
      "name": "string",
      "type": "code_metric"
    }
  ],
  "execution_policy": {
    "pass_threshold": 0,
    "runs_per_item": 0
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "is_latest": true,
  "items_added": 0,
  "items_deleted": 0,
  "items_modified": 0,
  "items_total": 0,
  "last_updated_at": "2026-06-09T00:00:00Z",
  "last_updated_by": "string",
  "metadata": {
    "additionalProp1": "string"
  },
  "tags": [
    "string"
  ],
  "version_hash": "string",
  "version_name": "string"
}
404Version not foundapplication/json
objectErrorMessage_Public
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
409Concurrent modification - the latest version changed during the restore; retryapplication/json
objectErrorMessage_Public
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu