Skip to contentSkip to page list

Docs

Read an experiment's setup

The experiment's datasets, targets and evaluators, with the version to send back when you save. Ask for fields=version to check for changes without transferring the setup.

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

{  "id": "string",  "slug": "string",  "name": "string",  "state": {},  "version": -9007199254740991,  "updatedAt": "string"}
api-reference/experiments/read-an-experiment-s-setup

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

slugstringrequired

The experiment's slug, or its id

At least 1 character

Query parameters

fieldsstring

Set to version to answer with the version and timestamp only

Responses

200

Success

application/json

idstringrequired
slugstringrequired
namestring | null
stateobject | null
Option 1object
The experiment setup: datasets, targets and evaluators. Read it, change it, send it back whole.
Option 2null
versionintegerrequired

Send this back as expectedVersion to save safely

Minimum -9007199254740991Maximum 9007199254740991
updatedAtstringrequired

ISO 8601 timestamp of the last save

400

The experiment is not an evaluations workbench (experiment_type_mismatch)

401

Missing or invalid API key, or the key lacks the permission

404

No such experiment in this project

Documentation