Schedules API (Phase 3)
Create recurring GPU jobs with cron expressions.
Create Schedule
curl -X POST https://api.pulserun.dev/v1/schedules \
-H "Authorization: Bearer pr_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Nightly fine-tuning",
"gpu": "a100_80gb",
"template": "pytorch",
"cron": "0 2 * * *",
"max_duration_hours": 4,
"max_cost": 5.00,
"prefer_spot": true,
"startup_script": "cd /workspace && python train.py"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Job name |
gpu | string | ✅ | GPU type slug |
template | string | ✅ | Template or "custom" |
cron | string | ✅ | Cron expression (e.g., 0 2 * * * = 2am daily) |
max_duration_hours | number | No | Auto-stop after N hours |
max_cost | number | No | Auto-stop if cost exceeds this |
prefer_spot | boolean | No | Use spot instances (default: true) |
docker_image | string | No | For custom template |
startup_script | string | No | Command to run on start |
List Schedules
curl https://api.pulserun.dev/v1/schedules \
-H "Authorization: Bearer pr_live_xxxxxxxxxxxxx"Update Schedule
curl -X PUT https://api.pulserun.dev/v1/schedules/{id} \
-H "Authorization: Bearer pr_live_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "cron": "0 3 * * 0", "max_cost": 10.00 }'Delete Schedule
curl -X DELETE https://api.pulserun.dev/v1/schedules/{id} \
-H "Authorization: Bearer pr_live_xxxxxxxxxxxxx"View Run History
curl https://api.pulserun.dev/v1/schedules/{id}/runs \
-H "Authorization: Bearer pr_live_xxxxxxxxxxxxx"Cron Examples
| Expression | Description |
|---|---|
0 2 * * * | Every day at 2:00 AM |
0 2 * * 0 | Every Sunday at 2:00 AM |
0 */6 * * * | Every 6 hours |
0 0 1 * * | First day of every month |