Stop Task
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
Unique identifier of the task to stop (UUID format)
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
| Status | Meaning |
|---|---|
| 200 | Stop signal accepted (or task already in a terminal state) |
| 401 | Unauthorized (invalid API key) |
| 403 | Forbidden (task belongs to a different organization) |
| 404 | Task not found |
| 422 | Validation error (malformed task_id) |
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
Authorizations
API Key for authentication
Path Parameters
Response
Successful Response
Available options:
pending, executing, paused, error, failed, completed, stopped Model representing human-in-the-loop approval records for tasks.
Attributes: wait_node_id (str): The id of the node that triggered this HITL.
Available options:
text, markdown, json, voice Available options:
default, harder Snapshot of the LLM provider used for this execution (request override or agent default at run time).
Snapshot of the LLM model name used for this execution (request override or agent default at run time).
Snapshot of the reasoning effort applied during this execution, when supported by the model.
Available options:
low, medium, high, xhigh 
