API ReferenceSchedules

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

FieldTypeRequiredDescription
namestringJob name
gpustringGPU type slug
templatestringTemplate or "custom"
cronstringCron expression (e.g., 0 2 * * * = 2am daily)
max_duration_hoursnumberNoAuto-stop after N hours
max_costnumberNoAuto-stop if cost exceeds this
prefer_spotbooleanNoUse spot instances (default: true)
docker_imagestringNoFor custom template
startup_scriptstringNoCommand 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

ExpressionDescription
0 2 * * *Every day at 2:00 AM
0 2 * * 0Every Sunday at 2:00 AM
0 */6 * * *Every 6 hours
0 0 1 * *First day of every month