import requests
url = "https://app.langwatch.ai/api/v1/test-suites/{id}/run"
payload = { "targets": [{ "referenceId": "<string>" }] }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({targets: [{referenceId: '<string>'}]})
};
fetch('https://app.langwatch.ai/api/v1/test-suites/{id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/test-suites/{id}/run \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"targets": [
{
"referenceId": "<string>"
}
]
}
'{
"scheduled": true,
"batchRunId": "<string>",
"setId": "<string>",
"jobCount": 123,
"skippedArchived": {
"scenarios": [
"<string>"
],
"targets": [
"<string>"
]
},
"items": [
{
"scenarioRunId": "<string>",
"scenarioId": "<string>",
"target": {
"type": "prompt",
"referenceId": "<string>"
},
"name": "<string>"
}
],
"runPlanId": "<string>",
"planName": "<string>",
"created": true,
"platformUrl": "<string>"
}Run a test suite
Run every scenario filed in the test suite against the targets sent with the request. The run is filed under a run plan named after the suite and its targets unless a name is sent. A request that names no target answers 422 suite_targets_required.
import requests
url = "https://app.langwatch.ai/api/v1/test-suites/{id}/run"
payload = { "targets": [{ "referenceId": "<string>" }] }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({targets: [{referenceId: '<string>'}]})
};
fetch('https://app.langwatch.ai/api/v1/test-suites/{id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/test-suites/{id}/run \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"targets": [
{
"referenceId": "<string>"
}
]
}
'{
"scheduled": true,
"batchRunId": "<string>",
"setId": "<string>",
"jobCount": 123,
"skippedArchived": {
"scenarios": [
"<string>"
],
"targets": [
"<string>"
]
},
"items": [
{
"scenarioRunId": "<string>",
"scenarioId": "<string>",
"target": {
"type": "prompt",
"referenceId": "<string>"
},
"name": "<string>"
}
],
"runPlanId": "<string>",
"planName": "<string>",
"created": true,
"platformUrl": "<string>"
}Authorizations
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
The test suite id.
1Body
The prompts, agents or workflows the suite runs against. A test suite stores none of its own, so a run states them.
Show child attributes
Show child attributes
The run plan this run joins or creates. Leave it out and the name is derived from the suite name and the targets.
1 - 200How many times each scenario and target pairing runs. Between 1 and 5; defaults to 1.
1 <= x <= 5The model that plays the user for every scenario in this run. Leave it out for the scenario or project default.
The model that judges every scenario in this run. Leave it out for the scenario or project default.
Repeat the same key to make a retry join the batch the first call started instead of running everything again. Defaults to a new key per call.
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.
Show child attributes
Show child attributes
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.
200Response
Success
True once the runs are queued.
The id of this batch. Every run started here carries it.
The result set the batch is filed under in the platform.
How many runs were queued.
What the run left out, and why.
Show child attributes
Show child attributes
Every run this call queued.
Show child attributes
Show child attributes
The run plan this run was filed under.
The name that plan answers to.
True when this run created the plan, false when it joined a plan already there.
Where to watch this run in the LangWatch platform.
Was this page helpful?