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

# cancelSchedule()

> `protected` **cancelSchedule**(`id`): `Promise`\<`boolean`>

Cancel a pending task by id.

Removes the task and re-arms the alarm to the next remaining deadline.
A recurring task that cancels its own id from inside its handler stays
cancelled — the run that is finishing does not re-insert it.

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| `id` | `string` | The task id returned by `queue` / `schedule` / `every` (or the stable id you supplied). |

**Returns**

`Promise`\<`boolean`>

`true` if a pending task was removed; `false` if no task with
that id exists.
