POST
/api/v1/public/threads/{thread_id}/agent/stopStop Agent
Stop a running task. This endpoint allows you to cancel an agent execution that is currently in progress.
Request
curl -X POST \"https://api.he2.ai/api/v1/public/threads/thread_456/agent/stop?project_id=proj_123" \-H "X-API-Key: he-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Path Parameters
| Parameter | Type | Description |
|---|---|---|
thread_id | string (required) | The thread ID of the running task |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
project_id | string (required) | Project ID |
Response
{ "success": true, "agent_run_id": "run_123", "status": "stopped"}Note: Once a task is stopped, it cannot be resumed. You'll need to create a new task if you want to continue.