> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/api-reference/scheduler/tasks.md).

# Tasks

Scheduler → Tasks endpoints.

A **scheduled task** sends an Email, SMS or Push campaign on a cron schedule (UTC), as a user you choose.

{% hint style="warning" %}
**Campaign tasks: `EmailCampaign`, `PushCampaign`, `SmsCampaign`.** On save, `task.type` names the channel and `campaign` is the same body that channel's create-campaign endpoint takes, without a time: `EmailCampaign` and `PushCampaign` take the nested campaign (`source`, `templateId`, `integrationId`, and the recipients for that source); `SmsCampaign` takes the flat SMS body (`deliveryType`, `templateId`, `integrationId` and the matching audience block, e.g. `phoneNumbers`) — its `projectId` is ignored, the task's project is used. Push and SMS since 2026-10-05. `CodeFunctionalCall` and `WebhookCall` are refused with `CM-ERRORS-SCHEDULER-008`, a missing or unknown `type` with `CM-ERRORS-SCHEDULER-007`. The cron has exactly 5 fields and runs in UTC. `initiatorUserId` must be you or a service user of the project (`CM-ERRORS-SCHEDULER-010` otherwise). There is no run-history endpoint yet.
{% endhint %}

| Endpoint                                                                                    | Method                   |
| ------------------------------------------------------------------------------------------- | ------------------------ |
| [Delete Scheduler Task](/codemash/api-reference/scheduler/tasks/delete-scheduler-task.md)   | `DELETE tasks/{Id}`      |
| [Disable Scheduler Task](/codemash/api-reference/scheduler/tasks/disable-scheduler-task.md) | `PUT tasks/{Id}/disable` |
| [Enable Scheduler Task](/codemash/api-reference/scheduler/tasks/enable-scheduler-task.md)   | `PUT tasks/{Id}/enable`  |
| [Get Scheduler Task](/codemash/api-reference/scheduler/tasks/get-scheduler-task.md)         | `GET tasks/{id}`         |
| [Get Scheduler Tasks](/codemash/api-reference/scheduler/tasks/get-scheduler-tasks.md)       | `GET tasks`              |
| [Save Scheduler Task](/codemash/api-reference/scheduler/tasks/save-scheduler-task.md)       | `POST tasks`             |
