Cancel a run
Requests cancellation of a queued or running run. A queued run is cancelled immediately. A running run is marked cancelled and the worker observes it at its next heartbeat, so this call does not wait for the agent to stop. Cancelling a run that has already finished is a no-op that returns the finished run unchanged, so a client that cancels twice does not get an error.
Requests cancellation of a queued or running run. A queued run is cancelled immediately. A running run is marked cancelled and the worker observes it at its next heartbeat, so this call does not wait for the agent to stop. Cancelling a run that has already finished is a no-op that returns the finished run unchanged, so a client that cancels twice does not get an error.
Path Parameters
The project the run belongs to.
The run to cancel.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/projects/string/runs/string/cancel"{ "id": "string", "projectId": "string", "status": "queued", "prompt": "string", "model": "string", "recipeId": "string", "steps": 0, "tokensIn": 0, "tokensOut": 0, "sandboxMs": 0, "error": "string", "startedAt": "string", "finishedAt": "string", "createdAt": "string"}Read a run GET
Returns one run's status and counters. Poll this, or follow the events endpoint, while a run is in flight.
Approve or refuse a run step POST
Records a person's decision on one approval and releases the run step it was raised for. A step the plan marks as costing credits, needing a signature, publishing, or reading a secret DOES NOT RUN until a decision approves it — this endpoint is what ends that wait, so the approval card in the dashboard is the control that runs the work, not a record of it. What the caller must know: the run is resolved through its project, so a run owned by another user answers the same 404 as a run that does not exist — never a 403, which would confirm the run is real. The approval id must belong to the run in the path; one raised by a different run is the same 404. `approved: true` releases the step so the run performs it at its next check of the gate, which is the step after the one it was refused on; a run whose budget is already spent, or that has finished, will not come back to it — read the run's events to see what the run did with the answer. The decision is final. An approval already decided answers 409, because two people looking at the same card and both pressing a button must not produce two answers with different timestamps. Decide the approval, then re-read `GET /projects/{projectId}/runs/{runId}/events` to see the run's reaction rather than assuming the step ran.