> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agi.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# phone_task_cancel

> Cancel one task while keeping the session open.

Cancels a single task without losing the workflow - the session stays open for follow-up tasks. Use it to stop a runaway task; use [`phone_session_end`](/api-reference/tools/phone-session-end) only when the entire workflow is finished.

## Parameters

<ParamField body="session_id" type="string" required>
  The active session that owns the task.
</ParamField>

<ParamField body="task_id" type="string" required>
  The task to cancel.
</ParamField>

<ParamField body="reason" type="string">
  Optional note recorded with the cancellation.
</ParamField>

## Behavior

* Monitor the original `task_id` until it reports `completed` with
  `terminal: "stopped_by_user"`.
* If the task finished before the cancel arrived, the response contains
  `already_completed: true` and nothing is sent to the phone - act on the
  task's actual `terminal` instead.

## Example

```json theme={null}
{
  "session_id": "session-uuid",
  "task_id": "task-uuid",
  "reason": "User changed their mind."
}
```

## Related

* [`phone_session_end`](/api-reference/tools/phone-session-end) - cancel everything and close the workflow
* [`phone_task_pause`](/api-reference/tools/phone-task-pause) - suspend instead of stopping
