# PATCH /event-schedules/:id

**Resource:** [Event Schedules](./event-schedules.md)  
**Scopes:** `schedules:write`  
**Write operation:** yes

Partial update — modify name, description, is_active, cron_expression, timezone, audience_type, audience_filter, automation_id, end_at, or max_runs. Changing cron_expression or timezone automatically recomputes next_run_at.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Event schedule ID |
| `name` | body | string | no | Schedule name |
| `description` | body | string | no | Schedule description |
| `is_active` | body | boolean | no | Enable or disable the schedule |
| `cron_expression` | body | string | no | 5-field cron expression |
| `timezone` | body | string | no | IANA timezone |
| `audience_type` | body | string | no | One of: users, tasks_by_assignee, contacts, deals |
| `audience_filter` | body | object | no | Audience-specific filter JSON |
| `automation_id` | body | uuid | no | Replace the linked automation |
| `end_at` | body | string | no | ISO timestamp after which the schedule stops firing (null to remove) |
| `max_runs` | body | number | no | Max fires before auto-deactivation (null to remove) |

## Request example

```bash
curl -X PATCH \
  "https://api.trustpager.com/functions/v1/api/v1/event-schedules/SCHEDULE_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"is_active": false}'
```

## Response example

```json
{
  "data": {
    "id": "a1b2c3d4-...",
    "name": "Daily Staff Digest",
    "is_active": false,
    "cron_expression": "0 9 * * 1-5",
    "timezone": "Australia/Sydney",
    "audience_type": "users",
    "audience_filter": {},
    "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`