Skip to contentSkip to page list

Docs

List a scenario's versions

List the saved versions of a scenario, newest first. A scenario saved before versions were recorded closes its history with a synthesized Created entry.

GET/api/v1/scenarios/{id}/versions
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/scenarios/<id>/versions"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

{  "versions": [    {      "version": -9007199254740991,      "authorLabel": "string",      "authorId": "string",      "changeDescription": "string",      "changedFields": [        "string"      ],      "createdAt": "string",      "isSynthesized": false    }  ],  "nextCursor": -9007199254740991}
api-reference/scenarios/list-a-scenario-s-versions

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

Query parameters

limitinteger
Minimum 1Maximum 100
cursorinteger

Read the page below this version number.

Minimum 1Maximum 9007199254740991

Responses

200

Success

application/json

versionsobject[]required
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.

nextCursorinteger | nullrequired

Pass as cursor to read the page below this one. Null on the last page.

Option 1integer
Option 2null
404

Scenario not found

application/json

errorstringrequired

Documentation