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.
Read one scenario version
Get one saved version of a scenario, with the name, situation, criteria, labels and parameters as that version saved them.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The response appears below.
Request and response examples
import osimport requestsorigin = "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())const url = "https://app.langwatch.ai/api/v1/scenarios/<id>/versions/<version>";const response = await fetch(url, { method: "GET", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request GET \ --url 'https://app.langwatch.ai/api/v1/scenarios/<id>/versions/<version>' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project.Request: GET https://app.langwatch.ai/api/v1/scenarios/<id>/versions/<version>Reference: https://langwatch.ai/docs/api-reference/scenarios/read-one-scenario-version.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.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": {} }}Scenario or version not found
application/json · Generated from schema
{ "error": "string"}Path parameters
idstringrequiredversionintegerrequiredResponses
200Success
application/json
versionintegerrequiredThe version number, counting from 1.
authorLabelstring | nullrequiredWhich surface wrote the version: user, api, cli or langy. Null on the synthesized Created entry of a scenario saved before versions were recorded.
authorIdstring | nullrequiredThe user who saved the version. Null when the save came from an API key.
changeDescriptionstring | nullrequiredchangedFieldsstring[]requiredThe fields whose value this save changed.
createdAtstringrequiredWhen the version was written, in ISO 8601.
isSynthesizedbooleanrequiredTrue on the Created entry a scenario saved before versions were recorded shows. It has no stored snapshot, so it cannot be read back.
schemaVersionintegerrequiredThe shape the snapshot was written in.
snapshotobjectrequiredThe editable content of the case as this version saved it.
404Scenario or version not found
application/json
errorstringrequired