Skip to main content
The 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.
Cancellation is irreversible. Once a mission transitions to the cancelled state it cannot be resumed. If you need to pause and resume, use signals instead.

Endpoint

Required scope: missions:write Required headers:

Path Parameters

runId
string (UUID)
required
The unique run identifier of the mission to cancel. Returned by POST /v8/missions when the mission was created.

Request Body

reason
string
required
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>