# Cancel a task
Ask a running task to stop. Read the task again to confirm its final status.
**Request:** `POST https://leadsagent.io/api/v1/tasks/{id}/cancel`
**Access:** leads:write.
**Response:** data is the task object with its latest status.

## Parameters

- `id` (UUID): Required. The task ID.

## cURL

```sh
curl --fail-with-body --silent --show-error --request POST "$LEADSAGENT_API_BASE/tasks/$TASK_ID/cancel" -H "X-API-Key: $LEADSAGENT_API_KEY"
```

## Example response

```
{
  "request_id": "6c4d0c26-8aa3-44b0-a50a-51b832b29465",
  "status": "success",
  "data": {
    "id": "73bd1ccb-1a44-4b41-84da-4ea7a5ad03f4",
    "kind": "agent",
    "status": "running",
    "prompt": "Find 20 dentists in Austin with emails",
    "source": "API key · research-example",
    "max_leads": 20,
    "created_at": "2026-10-21T12:00:00+00:00",
    "updated_at": "2026-10-21T12:00:00+00:00",
    "steps": [],
    "lead_count": 0,
    "results_ready": false,
    "status_url": "/api/v1/tasks/73bd1ccb-1a44-4b41-84da-4ea7a5ad03f4"
  },
  "meta": {}
}
```

## Notes

- Cancellation is a request. Work that already completed cannot be undone.
- A completed or failed task can still be read.

[Open the full API reference](https://leadsagent.io/documentation/api-reference)
