Stop Task
Stop a running task
Cancel a running task. Sends a stop signal to the worker executing the task, marks the execution asDocumentation Index
Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
| 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
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.
text, markdown, json, voice default, harder Snapshot of the effective LLM provider used for this execution. Reflects the per-execution override when supplied on the invocation request, otherwise falls back to the agent's configured provider.
Snapshot of the effective model name used for this execution. Reflects the per-execution override when supplied on the invocation request, otherwise falls back to the agent's configured model.
Snapshot of the effective reasoning effort used for this execution. Reflects the per-execution override when supplied on the invocation request, otherwise falls back to the agent's configured reasoning effort.
low, medium, high, xhigh 
