import requests
url = "https://app.langwatch.ai/api/scenarios/{id}/versions/{version}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/scenarios/{id}/versions/{version}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/scenarios/{id}/versions/{version} \
--header 'X-Auth-Token: <api-key>'{
"version": 123,
"authorLabel": "<string>",
"authorId": "<string>",
"changeDescription": "<string>",
"changedFields": [
"<string>"
],
"createdAt": "<string>",
"isSynthesized": true,
"schemaVersion": 123,
"snapshot": {
"name": "<string>",
"situation": "<string>",
"criteria": [
"<string>"
],
"labels": [
"<string>"
],
"parameters": [
{
"name": "<string>",
"description": "<string>",
"defaultValue": "<string>",
"secret": true
}
],
"simulatorModel": "<string>",
"judgeModel": "<string>",
"maxTurns": 123,
"minTurns": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Read one scenario version
Get one saved version of a scenario, with the name, situation, criteria, labels and parameters as that version saved them.
import requests
url = "https://app.langwatch.ai/api/scenarios/{id}/versions/{version}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/scenarios/{id}/versions/{version}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/scenarios/{id}/versions/{version} \
--header 'X-Auth-Token: <api-key>'{
"version": 123,
"authorLabel": "<string>",
"authorId": "<string>",
"changeDescription": "<string>",
"changedFields": [
"<string>"
],
"createdAt": "<string>",
"isSynthesized": true,
"schemaVersion": 123,
"snapshot": {
"name": "<string>",
"situation": "<string>",
"criteria": [
"<string>"
],
"labels": [
"<string>"
],
"parameters": [
{
"name": "<string>",
"description": "<string>",
"defaultValue": "<string>",
"secret": true
}
],
"simulatorModel": "<string>",
"judgeModel": "<string>",
"maxTurns": 123,
"minTurns": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<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.
Response
Success
The version number, counting from 1.
Which surface wrote the version: user, api, cli or langy. Null on the synthesized Created entry of a case saved before versions were recorded.
The user who saved the version. Null when the save came from an API key.
The fields whose value this save changed.
When the version was written, in ISO 8601.
True on the Created entry a case saved before versions were recorded shows. It has no stored snapshot, so it cannot be read back.
The shape the snapshot was written in.
The editable content of the case as this version saved it.
Show child attributes
Show child attributes
Was this page helpful?