Restore an experiment version
import requests
url = "https://app.langwatch.ai/api/experiments/{slug}/versions/{version}/restore"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/experiments/{slug}/versions/{version}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/experiments/{slug}/versions/{version}/restore \
--header 'X-Auth-Token: <api-key>'{
"version": 123
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}{
"error": "<string>",
"currentVersion": 123,
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}Experiments
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
/
experiments
/
{slug}
/
versions
/
{version}
/
restore
Restore an experiment version
import requests
url = "https://app.langwatch.ai/api/experiments/{slug}/versions/{version}/restore"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/experiments/{slug}/versions/{version}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/experiments/{slug}/versions/{version}/restore \
--header 'X-Auth-Token: <api-key>'{
"version": 123
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}{
"error": "<string>",
"currentVersion": 123,
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}Authorizations
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
The version to restore, as listed by GET /api/experiments/{slug}/versions
Required range:
x >= 1Response
Version restored
The new version the restore wrote. History is never rewritten, so the restored version is still in the list.
Last modified on August 24, 2026
Was this page helpful?
⌘I