# POST /event-schedules

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

Create an automation event schedule. Accepts cron_expression or time_of_day. The Source Data (what feeds the automation) is set by source_kind: "audience" (default, CRM records via audience_type/audience_filter), "external_feed" (poll a JSON URL via source_config), or "static" (fixed trigger data via source_config).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `name` | body | string | yes |  |
| `source_kind` | body | string | no | Source of rows: 'audience' (default), 'external_feed', or 'static'. Each resolved row fires the automation once with the row's fields as trigger_data. |
| `audience_type` | body | string | no | Required when source_kind='audience'. One of: users, tasks_by_assignee, stakeholder_bucket, deals. ('contacts' is retained for existing schedules but deprecated for new ones — use stakeholder_bucket for a curated contact group.) |
| `automation_id` | body | string | yes |  |
| `cron_expression` | body | string | no |  |
| `time_of_day` | body | string | no |  |
| `timezone` | body | string | no |  |
| `audience_filter` | body | object | no |  |
| `source_config` | body | object | no | Config for non-audience sources. external_feed: { feed_url (required, tokenised JSON URL), format:'json_array', dedupe_key (required, the record key holding the stable external id), first_run:'seed'\|'import_all' (default 'seed' = record everything as seen and import nothing on the first fire), filters:[{ field, op:'not_empty'\|'equals'\|'not_equals'\|'in', value? }] }. static: { trigger_data:{...} } (one fixed row per fire) or { rows:[{...}] }. Feed field mapping to lead fields lives in the attached automation's create_lead action, using sanitised {{token}} names. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/event-schedules"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","audience_type":"...","automation_id":"..."}'
```

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