Skip to contentSkip to page list

Docs

Run a configuration under a name

Run a configuration under a name. The name identifies the run plan: send a name already in use and that plan's configuration is replaced with this one, send a new name and the plan is created, send no name and one is derived from what the run covers and what it runs against.

POST/api/v1/run-plans/run
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/run-plans/run"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}payload = {    "config": {},}​response = requests.post(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "scheduled": false,  "batchRunId": "string",  "setId": "string",  "jobCount": 0,  "skippedArchived": {    "scenarios": [      "string"    ],    "targets": [      "string"    ]  },  "items": [    {      "scenarioRunId": "string",      "scenarioId": "string",      "target": {        "type": "prompt",        "referenceId": "string",        "scenarioMappings": {},        "runParameters": {},        "runSecretParameterNames": [          "string"        ]      },      "name": "string"    }  ],  "runPlanId": "string",  "planName": "string",  "created": false,  "platformUrl": "string"}
api-reference/run-plans/create-run

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.

Request body

application/json · Required

namestring

The run plan this run joins or creates. A run plan is identified by its name, so sending the same name again replaces that plan's configuration with this one. Leave it out and the name is derived from what the run covers and what it runs against. Up to 200 characters.

At least 1 characterUp to 200 characters
configobjectrequired

What this run covers and what it runs against. Written onto the run plan the name resolves.

scopeobjectrequired

What the run plan covers: all (every active scenario), test_suites (the scenarios filed in the named test suites), labels (the scenarios carrying any of the labels), or scenarios (the scenarioIds sent with the configuration). A dynamic scope is resolved again at every run, so a scenario written later runs without editing the plan.

targetsobject[]required

The prompts, agents or workflows every scenario runs against. Every target runs every scenario, so naming more than one compares them in the same run.

repeatCountinteger

How many times each scenario and target pairing runs. Between 1 and 5; defaults to 1.

Minimum 1Maximum 5
simulatorModelstring | null

The model that plays the user for every scenario in the run. Overrides each scenario's own choice. Leave it out for the scenario or project default.

judgeModelstring | null

The model that judges every scenario in the run. Overrides each scenario's own choice. Leave it out for the scenario or project default.

scenarioIdsstring[]

The scenarios a test_suites or scenarios scope covers. Read by a scenarios scope alone; a scope that states a rule resolves its own list at run time.

evaluatorsobject[]

The plan's own evaluators, run beside the ones attached to the test suites its scenarios belong to. A plan evaluator reads the conversation and the trace, never a scenario field. Leave it out to keep what the plan already holds.

idempotencyKeystring

Repeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.

parametersobject

Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name, and a target that names the same parameter in its runParameters overrides it for that target.

notestring

One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.

Up to 200 characters

Responses

200

Success

application/json

scheduledbooleanrequired

True once the runs are queued.

batchRunIdstringrequired

The id of this batch. Every run started here carries it.

setIdstringrequired

The result set the batch is filed under in the platform.

jobCountnumberrequired

How many runs were queued.

skippedArchivedobjectrequired

What the run left out, and why.

scenariosstring[]required

Scenarios left out because they are archived.

targetsstring[]required

Targets left out because they are archived.

itemsobject[]required

Every run this call queued.

scenarioRunIdstringrequired

The id of this single run.

scenarioIdstringrequired

The scenario that was run.

targetobjectrequired

What it was run against.

namestring | nullrequired

The scenario name, when known.

runPlanIdstringrequired

The run plan this run was filed under.

planNamestringrequired

The name that plan answers to.

createdbooleanrequired

True when this run created the plan, false when it joined a plan already there.

platformUrlstring (uri)required

Where to watch this run in the LangWatch platform.

Documentation