## Create a worker schedule **post** `/api/workers/{workerId}/schedules` Schedule a worker instruction for a future or recurring run. ### Path Parameters - `workerId: string` ### Body Parameters - `input: string` - `when: object { date, type } or object { delayInSeconds, type } or object { cron, type } or object { intervalSeconds, type }` - `object { date, type }` - `date: string` - `type: "scheduled"` - `"scheduled"` - `object { delayInSeconds, type }` - `delayInSeconds: number` - `type: "delayed"` - `"delayed"` - `object { cron, type }` - `cron: string` - `type: "cron"` - `"cron"` - `object { intervalSeconds, type }` - `intervalSeconds: number` - `type: "interval"` - `"interval"` - `budget: optional "low" or "standard" or "high" or "unlimited"` - `"low"` - `"standard"` - `"high"` - `"unlimited"` ### Returns - `WorkerSchedule = object { id, budget, input, 2 more } or object { id, budget, delayInSeconds, 3 more } or object { id, budget, cron, 3 more } or object { id, budget, input, 3 more }` - `object { id, budget, input, 2 more }` - `id: string` - `budget: "low" or "standard" or "high" or "unlimited"` - `"low"` - `"standard"` - `"high"` - `"unlimited"` - `input: string` - `nextRunAt: string` - `type: "scheduled"` - `"scheduled"` - `object { id, budget, delayInSeconds, 3 more }` - `id: string` - `budget: "low" or "standard" or "high" or "unlimited"` - `"low"` - `"standard"` - `"high"` - `"unlimited"` - `delayInSeconds: number` - `input: string` - `nextRunAt: string` - `type: "delayed"` - `"delayed"` - `object { id, budget, cron, 3 more }` - `id: string` - `budget: "low" or "standard" or "high" or "unlimited"` - `"low"` - `"standard"` - `"high"` - `"unlimited"` - `cron: string` - `input: string` - `nextRunAt: string` - `type: "cron"` - `"cron"` - `object { id, budget, input, 3 more }` - `id: string` - `budget: "low" or "standard" or "high" or "unlimited"` - `"low"` - `"standard"` - `"high"` - `"unlimited"` - `input: string` - `intervalSeconds: number` - `nextRunAt: string` - `type: "interval"` - `"interval"` ### Example ```http curl https://v3.handinger.com/api/workers/$WORKER_ID/schedules \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $HANDINGER_API_KEY" \ -d '{ "input": "x", "when": { "date": "2019-12-27T18:11:19.117Z", "type": "scheduled" } }' ``` #### Response ```json { "id": "id", "budget": "low", "input": "input", "nextRunAt": "2019-12-27T18:11:19.117Z", "type": "scheduled" } ```