v3
OpenAPI 3.1.02026-07-31350397683.8 KBCancel Simulation Run
Cancel an in-flight simulation run.
Cascades the cancel down to child test_results:
- Set simulation_run.status = COMPLETED (the only terminal state after the SimulationRunStatus collapse). The fact that the user cancelled the run is captured by child test_result rows transitioning to CANCELLED, not by a distinct sim_run status.
- For each child test_result still in PRE_RUNNING_STATUSES, call mark_cancelled_async() — guarded so it raises if a status snuck out of pre-running between our read and write.
- Children that already started running (RUNNING / CONVERSATION_ENDED / EVALUATING) are LEFT ALONE — they keep their natural terminal status so dropped/completed calls still produce meaningful eval data.
- Bump simulation_run.tests_cancelled by the cascade count.
The endpoint is idempotent for already-terminal sim runs (returns success=False with a message; doesn't try to re-cancel).
post/v1/simulation-runs/{simulation_run_id}/cancel
Path parameters
simulation_run_idinteger required
Headers
X-API-Keystring required
API key required to authenticate requests.
Response
Successful Response