Skip to contentSkip to page list

Docs

Restore an experiment version

Bring an old setup back by writing it forward as a new save. History is never rewritten: the version you restored from stays in the list, and the restore is one more entry after it.

POST/api/v1/experiments/{slug}/versions/{version}/restore
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/experiments/<slug>/versions/<version>/restore"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.post(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "version": 0}
api-reference/experiments/restore-an-experiment-version

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Path parameters

slugstringrequired
At least 1 character
versionintegerrequired

The version to restore, as listed by GET /api/experiments/{slug}/versions

Minimum 0Maximum 9007199254740991

Responses

200

Success

application/json

versionnumberrequired

The new version the restore wrote. History is never rewritten, so the restored version is still in the list.

401

Missing or invalid API key, or the key lacks the permission

404

No such experiment or version in this project

409

Someone else saved since you read this state (experiment_stale_workbench_state).

Documentation