POST /v8/missions/{runId}/cancel endpoint requests graceful cancellation of a mission that is currently running or waiting. The gateway propagates the cancellation request to the Control Plane, which signals the agent to stop after finishing its current step. The mission status transitions to cancelled and the event stream emits a final mission.cancelled event before closing. Cancellation is cooperative — the agent completes whatever atomic step it is currently executing before stopping, so there is a brief window between your request and the final status transition.
Endpoint
missions:write
Required headers:
Path Parameters
The unique run identifier of the mission to cancel. Returned by
POST /v8/missions when the mission was created.Request Body
A human-readable explanation for why the mission is being cancelled. Must be between 1 and 500 characters. This value is recorded in the mission’s audit log and surfaces in trace data — use it to provide context for operators and for your own debugging.Examples:
"User requested cancellation", "Budget exceeded before goal was confirmed", "Replacing with updated goal specification".Example Request
Response
Status:200 OK
A 200 OK confirms that the cancellation request has been propagated to the Control Plane. The mission has not necessarily reached the cancelled state at the moment this response is returned — the agent finishes its in-progress step first.
To confirm the mission has fully cancelled, poll GET /v8/missions/{runId} until status equals "cancelled", or listen on the event stream for the mission.cancelled event.
External outcomes that were already committed by the agent before cancellation are independently verified and remain valid. Cancellation prevents future steps from being taken; it does not roll back completed work.
Error Responses
All errors follow RFC 9457 Problem Details.SDK Equivalent
Returns:
Promise<void>