Skip to contentSkip to page list

Docs

Read one scenario version

Get one saved version of a scenario, with the name, situation, criteria, labels and parameters as that version saved them.

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

Success

application/json · Generated from schema

{  "version": -9007199254740991,  "authorLabel": "string",  "authorId": "string",  "changeDescription": "string",  "changedFields": [    "string"  ],  "createdAt": "string",  "isSynthesized": false,  "schemaVersion": -9007199254740991,  "snapshot": {    "name": "string",    "situation": "string",    "criteria": [      "string"    ],    "labels": [      "string"    ],    "parameters": [      {        "name": "string",        "description": "string",        "defaultValue": "string",        "secret": false,        "type": "string",        "options": [          null        ],        "required": false      }    ],    "simulatorModel": "string",    "judgeModel": "string",    "maxTurns": 0,    "minTurns": 0,    "fields": {}  }}
api-reference/scenarios/read-one-scenario-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

idstringrequired
At least 1 character
versionintegerrequired
Minimum 1Maximum 9007199254740991

Responses

200

Success

application/json

versionintegerrequired

The version number, counting from 1.

Minimum -9007199254740991Maximum 9007199254740991
authorLabelstring | nullrequired

Which surface wrote the version: user, api, cli or langy. Null on the synthesized Created entry of a scenario saved before versions were recorded.

authorIdstring | nullrequired

The user who saved the version. Null when the save came from an API key.

changeDescriptionstring | nullrequired
changedFieldsstring[]required

The fields whose value this save changed.

createdAtstringrequired

When the version was written, in ISO 8601.

isSynthesizedbooleanrequired

True on the Created entry a scenario saved before versions were recorded shows. It has no stored snapshot, so it cannot be read back.

schemaVersionintegerrequired

The shape the snapshot was written in.

Minimum -9007199254740991Maximum 9007199254740991
snapshotobjectrequired

The editable content of the case as this version saved it.

namestringrequired
situationstringrequired
criteriastring[]required
labelsstring[]required
parametersobject[]required
simulatorModelstring | nullrequired
judgeModelstring | nullrequired
maxTurnsnumber | nullrequired
minTurnsnumber | nullrequired
fieldsobject

The field values as this version saved them. Absent on servers that predate suite fields.

404

Scenario or version not found

application/json

errorstringrequired

Documentation