Skip to contentSkip to page list

Docs

Trigger a suite run

Trigger a suite run. Schedules scenario executions for all active scenarios x targets x repeatCount. When the id names a test suite, the targets, the repeat count and the models are read from the body. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.

POST/api/v1/suites/{id}/run
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/suites/<id>/run"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.post(    origin + path,    headers=headers,)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"    }  ],  "planName": "string",  "created": false,  "planSlug": "string"}
api-reference/suites/action-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.

Path parameters

idstringrequired
At least 1 character

Request body

application/json

idempotencyKeystring
namestring

The run plan this run joins or creates. Used only when the id names a test suite; derived from the suite name and the targets when absent.

At least 1 characterUp to 200 characters
targetsobject[]

The prompts, agents or workflows the run goes against. Read only when the id names a test suite, which stores no target of its own; a run plan already holds its own and refuses these.

typestringrequired
One of"prompt""http""code""workflow""connected""voice"
referenceIdstringrequired
At least 1 character
scenarioMappingsobject
runParametersobject
runSecretParameterNamesstring[]
repeatCountinteger

How many times each scenario and target pairing runs, between 1 and 5. Used only when the id names a test suite.

Minimum 1Maximum 5
simulatorModelstring | null

The model that plays the user for every scenario in the run. Used only when the id names a test suite.

judgeModelstring | null

The model that judges every scenario in the run. Used only when the id names a test suite.

traceQuietPeriodMsinteger | null

Milliseconds (0 to 60000) the agent's trace must stay unchanged before the judge reads it, for every scenario in the run. Used only when the id names a test suite.

Option 1integer
Option 2null
traceWaitTimeoutMsinteger | null

Milliseconds (1000 to 300000) the judge waits for the agent's trace before a verdict, for every scenario in the run. Used only when the id names a test suite.

Option 1integer
Option 2null
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.

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
batchRunIdstringrequired
setIdstringrequired
jobCountnumberrequired
skippedArchivedobjectrequired
scenariosstring[]required
targetsstring[]required
itemsobject[]required
scenarioRunIdstringrequired
scenarioIdstringrequired
targetobjectrequired
namestring | nullrequired
planNamestring
createdboolean
planSlugstringrequired
404

Not Found

application/json

errorstringrequired
messagestring

Documentation