import requests
url = "https://app.langwatch.ai/api/scenarios/{id}"
payload = { "name": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://app.langwatch.ai/api/scenarios/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://app.langwatch.ai/api/scenarios/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"situation": "<string>",
"criteria": [
"<string>"
],
"labels": [
"<string>"
],
"parameters": [
{
"name": "<string>",
"description": "<string>",
"defaultValue": "<string>",
"secret": true
}
],
"platformUrl": "<string>",
"simulatorModel": "<string>",
"judgeModel": "<string>",
"maxTurns": 123,
"minTurns": 123,
"testSuiteId": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Update an existing scenario
Update an existing scenario
import requests
url = "https://app.langwatch.ai/api/scenarios/{id}"
payload = { "name": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://app.langwatch.ai/api/scenarios/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://app.langwatch.ai/api/scenarios/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"situation": "<string>",
"criteria": [
"<string>"
],
"labels": [
"<string>"
],
"parameters": [
{
"name": "<string>",
"description": "<string>",
"defaultValue": "<string>",
"secret": true
}
],
"platformUrl": "<string>",
"simulatorModel": "<string>",
"judgeModel": "<string>",
"maxTurns": 123,
"minTurns": 123,
"testSuiteId": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<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
Body
1The parameters this scenario declares by name, each with an optional description and default. A run supplies values for these names, readable from the scenario's own text as params.NAME. A parameter marked secret carries no default: its value is supplied per run, encrypted, delivered to the target as secrets.NAME, and never readable from the scenario's own text.
20Show child attributes
Show child attributes
Model for the simulated user, e.g. openai/gpt-5-mini. Null uses the project default.
200^[a-zA-Z0-9_-]+(?:\/[^\s/]+)+$Model for the judge, e.g. openai/gpt-5-mini. Null uses the project default.
200^[a-zA-Z0-9_-]+(?:\/[^\s/]+)+$Maximum conversation turns for a run of this scenario. Null uses the default.
1 <= x <= 100Minimum conversation turns before the judge may end the run. Null uses the default.
0 <= x <= 100The test suite to file this scenario in. It must name a non-archived test suite of the same project. null files the scenario into the project's Default test suite.
Response
Scenario updated
Show child attributes
Show child attributes
The model that plays the user, or null for the project default. Absent on servers that predate model overrides on this family.
The model that judges the run, or null for the project default. Absent on servers that predate model overrides on this family.
The most conversation turns a run of this scenario takes, or null for the default. Absent on servers that predate turn limits on this family.
The fewest conversation turns before the judge may end a run, or null for the default. Absent on servers that predate turn limits on this family.
The test suite this scenario is filed in, or null when unfiled. Absent on servers that predate test suites.
Was this page helpful?