v3

OpenAPI 3.1.02026-07-31350397683.8 KB

Cancel Simulation Run

Cancel an in-flight simulation run.

Cascades the cancel down to child test_results:

  1. 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.
  2. 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.
  3. 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.
  4. 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

successboolean required

True if the sim run was marked CANCELLED

simulation_run_idinteger required

The sim run that was acted upon

cancelled_test_result_idsinteger[]

Pre-running test_results that were cascaded to CANCELLED

left_running_test_result_idsinteger[]

Children in RUNNING / CONVERSATION_ENDED / EVALUATING — left alone so they reach their own natural terminal status instead of being force-cancelled mid-call

messagestring required

Human-readable summary