Skip to main content
Where Simulations are ad-hoc, test scenarios are saved, repeatable test cases for an agent. Scenarios can be written by hand, generated by AI from the agent’s prompt, or promoted from a real production call (optionally anchored to an issue report). Executing scenarios produces a test run (a simulation batch under the hood), optionally expanded across a matrix of audio/speech/behavior conditions. Suites bundle scenarios into a pass/fail release gate that can run on a schedule.

Endpoints

Scenario object

Create / update / delete

POST requires title + scenario_prompt (other fields optional, defaults above) and returns 201. PATCH accepts any subset. DELETE returns 204.

AI-generate scenarios

Returns 201 with {"scenarios": [ … ]} (source: "ai"), or 502 if generation failed.

Refresh stale scenarios

After you change the agent’s prompt, AI scenarios go is_stale: true. POST /test-scenarios/refresh with {"scenario_ids": [...]} (≤ 50) or {"only_stale": true} (or an empty body to refresh all) re-generates their briefs against the current prompt and returns {"scenarios": [...]}. 502 on generation failure.

Promote a call to a scenario

Builds one regression scenario from a real call’s transcript, grade, and (optionally) a filed issue.
Returns 201 with the new scenario (source: "production"). If the same call (+ same issue) was already promoted, returns 200 with the existing scenario instead of creating a duplicate. 400 when the turn index is out of range or not an agent turn.

Test runs (execute scenarios)

Returns 201 with the test-run object. 422 when no scenarios match; 404 for a missing phone number.

Test-run object

Test runs are returned by GET /test-runs (array, limit ≤ 200 default 50, offset) without per-run details, and by GET /test-runs/{batch_id} with a runs array:
Per-run verdict is pass / fail / unknown (derived from the grade when the run completes). call_id is the public call id — link it to GET /v1/calls/{call_id}.

Suites (release gates)

A suite is a named set of scenarios for one agent plus pass criteria. Suite runs are recorded against the suite; scheduled runs fire automatically (hourly / daily / weekly), and the dashboard’s Simulations page can trigger them on demand.

Suite object

Create / update a suite

POST /v1/suites returns 201; PATCH /v1/suites/{suite_id} accepts any subset; DELETE returns 204. List and detail responses embed the suite’s most recent runs (up to 50). A run’s verdict becomes pass only when the pass rate meets min_pass_rate and (if enabled) no critical-severity failures occurred; regressions lists scenarios that passed in the baseline run but fail now.

Simulations

The run/batch primitives test runs are built on.

Issue Reports

Promote issues into regression scenarios and track regression_guarded.

Agents

Scenario staleness tracks the agent’s prompt.

Calls

Every scenario run produces a call log.