# PATCH /auto-schedules/:schedule_id

**Resource:** [Auto Schedules](./auto-schedules.md)  
**MCP tool:** `update_auto_schedule`  
**Scopes:** `schedules:write`  
**Write operation:** yes

Update an Auto Schedule. source_kind and source_config are validated as a MERGED state, so a patch that only clears the repeat interval or only widens the source config is refused the same way a bad create would be. A schedule still on the retired 'audience' source can be renamed, paused or deleted, but cannot be edited to stay on it.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `schedule_id` | path | string | yes |  |
| `name` | body | string | no |  |
| `cron_expression` | body | string | no |  |
| `time_of_day` | body | string | no |  |
| `timezone` | body | string | no |  |
| `source_kind` | body | string | no | The Source Data primitive. See create_auto_schedule for what each one selects. 'audience' is retired and cannot be set. |
| `source_config` | body | object | no | Config for the chosen source_kind. See create_auto_schedule for the full per-source shape. Replaces the stored config wholesale, so send the complete object. |
| `is_active` | body | boolean | no |  |
| `end_at` | body | string | no |  |
| `max_runs` | body | number | no |  |
| `row_cooldown_days` | body | number | no | Repeat interval: how many days before the SAME record may fire again. 0 means every run. Required for workflow_stage, expiry_date, staff and stakeholder_group, and a patch cannot clear it back to null. See create_auto_schedule. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/auto-schedules/:schedule_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","cron_expression":"...","time_of_day":"..."}'
```

## Response example

```json
{
  "data": {
    "id": "a1b2c3d4-...",
    "name": "Daily Staff Digest",
    "is_active": false,
    "cron_expression": "0 9 * * 1-5",
    "timezone": "Australia/Sydney",
    "source_kind": "report",
    "source_config": { "recipients": { "user_ids": ["7ff7ab52-63d7-41d0-b96c-3872d5afed4f"] } },
    "automation_id": "b2c3d4e5-...",
    "next_run_at": "2026-04-21T23:00:00+00:00",
    "last_run_at": null,
    "run_count": 0,
    "max_runs": null,
    "end_at": null,
    "created_at": "2026-04-19T10:00:00Z",
    "updated_at": "2026-04-19T10:30:00Z"
  },
  "meta": { "credits_remaining": 9987 }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`