Update a test scenario
Patch an existing test-harness scenario. Every field is optional, only the fields you send change. Resolve the scenarioId with list_scenarios first. Use this to rewrite the caller agent's instructions brief, tighten the expected-outcome judge prompt, rename it, move it between folders, retag it, switch connectionMode (bridge / phone), switch toolMode (mock / real, where real lets a run call the customer's live API), set or clear callerModel (the caller agent's LLM override), or change its attachments: metricIds (which catalogue metrics grade it), personaId (the simulated caller's persona, voice scenarios), testProfileId (caller-identity fixture data), language, workflowChecks (checks on the agent's pre-call, hang-up and post-call functions) and callSetup (how the call starts: inbound, lead callback or campaign call). workflowChecks and callSetup replace the stored value whole, so read the scenario with get_scenario first. This edits the TEST HARNESS only, it never changes the agent's own behaviour.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Path Parameters
Workspace slug (GET /me lists yours).
Agent slug within the workspace.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X PATCH "https://example.com/workspaces/string/agents/string/tests/string" \ -H "Content-Type: application/json" \ -d '{}'{
"scenarioId": "string",
"property1": null,
"property2": null
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}List test scenarios GET
List the agent's test-harness scenarios (the simulated callers the eval engine plays) with each one's id, name, scenarioType (conditional / instruction / scripted), folder, tags, and latest-run status. Call this FIRST to resolve a scenario id before update_scenario, and before create_scenario so you don't duplicate one that already exists. Optionally filter by folder. This reads the test harness, it does not change the agent.
Cancel a test run POST
Cancel an in-flight test batch (the one run_all_tests returned). Queued runs never start; calls already in flight finish and keep their verdicts; the batch ends as 'cancelled'. Use this immediately when the operator wants a runaway or mis-configured sweep stopped, every queued run that never starts is credits saved. Fails cleanly if the batch already finished.