REST API - Tasks
Stop Task
Stop a running task
POST
Stop Task
Cancel a running task. Sends a stop signal to the worker executing the task, marks the execution as
stopped, and sets is_manually_stopped: true. Returns the updated task record.
The endpoint is idempotent: calling it on a task that is already in a terminal state (completed, failed, stopped) returns the current execution unchanged.
Path Parameters
Response
Returns the updated Agent Execution object withstatus set to stopped and is_manually_stopped set to true.
Example Request
Example Response
Response Status Codes
Important Notes
- Idempotent - Tasks already in
completed,failed, orstoppedare returned unchanged - Asynchronous - The worker may take a few seconds to observe the stop signal and exit cleanly. Poll Get Task until
statusbecomesstopped - Self-hosted environments - For agents running in a self-hosted environment, the stop request is routed cross-environment via the asset-command channel
- Manual flag -
is_manually_stopped: truedistinguishes user-initiated cancels from system-side terminations
Example: Stop and confirm
Use Cases
- Cancel a runaway agent - Halt an execution that is consuming too much time or tokens
- User-initiated cancel - Wire a “Stop” button in your UI to this endpoint
- Abort long-running tasks - Free up worker capacity when a task is no longer needed
- Recover from stuck tasks - Force-terminate executions that are not progressing
Response
Successful Response

