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 gois_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 byGET /test-runs (array, limit ≤ 200
default 50, offset) without per-run details, and by
GET /test-runs/{batch_id} with a runs array:
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.
Related
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.