Skip to content

Schedules API

Fresh

Source: BIBLE.md (Phase 5 Scheduling, Phase 12 Autopilot)

Routes

MethodRouteBody
POST/schedulesfull schedule object
GET/schedules-
GET/schedules/:id-
DELETE/schedules/:id-
POST/schedules/:id/pause-
POST/schedules/:id/resume-
POST/schedules/autopilotengages 3 default daemons
DELETE/schedules/autopilotdisengages all 3

Create schedule

bash
curl -X POST http://localhost:4700/schedules \
  -H "Content-Type: application/json" \
  -H "x-api-key: ghost-engine-key" \
  -d '{
    "jobType": "ctr",
    "campaignId": "dallas-junk-removal",
    "runsPerDay": 50,
    "startHour": 8,
    "endHour": 22,
    "spreadStrategy": "natural",
    "daysOfWeek": [1,2,3,4,5],
    "timezone": "America/Chicago"
  }'

Fields

FieldValuesDefault
jobTypectr, warmup, rank-check, cascade, cookie-refresh, phase-runrequired
campaignIdstringoptional
runsPerDaynumber50
startHour0-238
endHour0-2322
spreadStrategynatural/even/burstnatural
daysOfWeekarray of 0-6[1,2,3,4,5]
timezonetz stringAmerica/Chicago
jobConfigobject{}

Autopilot

bash
# Engage
curl -X POST http://localhost:4700/schedules/autopilot \
  -H "x-api-key: ghost-engine-key"

# Disengage
curl -X DELETE http://localhost:4700/schedules/autopilot \
  -H "x-api-key: ghost-engine-key"

Creates 3 schedules: warmup, cookie-refresh, phase-run.

Pause / Resume

bash
curl -X POST http://localhost:4700/schedules/sched-abc/pause -H "x-api-key: ghost-engine-key"
curl -X POST http://localhost:4700/schedules/sched-abc/resume -H "x-api-key: ghost-engine-key"