REST API
Every action in the web UI is also available over JSON. Use it to wire claude-scheduler into your CI, your own dashboards, or other agents.
Authentication
Two ways, in order of preference for scripts:
- API key (recommended) — org-scoped, admin role, revocable any time. Created from Settings → API keys. Pro / Team plans only.
- Session cookie — what the dashboard uses. Convenient for browser-side scripts, not for CI.
# create the key once from the dashboard, copy it now (only shown once) export CS_KEY=csk_live_… curl -fsS https://cronforclaude.com/api/projects \ -H "Authorization: Bearer $CS_KEY"
Quota + plan errors
When a plan limit is hit, the endpoint returns HTTP 402 Payment Required with a body shaped like { error, code } where code is one of schedules, jobs, runners, members, api_keys. Scripts should treat 402 as a hard stop and surface the message verbatim.
403 is permission related — most often the key was created on a Free-plan org and is calling a Pro-only feature. 401 means the key is invalid or revoked.
Endpoints
| Method | Path | Notes |
|---|---|---|
| GET | /api/projects | list (?includeArchived=1 to include) |
| POST | /api/projects | create (admin) |
| GET | /api/projects/:idOrSlug | by id or slug |
| PATCH | /api/projects/:idOrSlug | partial update (admin) |
| DELETE | /api/projects/:idOrSlug | cascades (admin) |
| GET | /api/schedules | list |
| POST | /api/schedules | create (admin) |
| GET | /api/schedules/:id | |
| PATCH | /api/schedules/:id | partial update (admin) |
| DELETE | /api/schedules/:id | (admin) |
| POST | /api/schedules/:id/trigger | enqueue one job now |
| DELETE | /api/schedules/:id/session | drop saved Claude session id |
| GET | /api/jobs | list (filters: status, project, scheduleId) |
| GET | /api/jobs/:id | full row incl prompt/stdout/stderr |
| GET | /api/jobs/:id/events | stream-json events, paginated |
| POST | /api/jobs/:id/cancel | |
| POST | /api/jobs/:id/replay | re-enqueue same prompt |
| POST | /api/jobs/cancel-queued | ?project=&scheduleId= (admin) |
| GET | /api/runners | list (token hash redacted) |
| POST | /api/runners | create + return one-time token (admin) |
| DELETE | /api/runners/:id | (admin) |
| GET | /api/settings | org settings (token masked) |
| PUT | /api/settings | update (admin) |
| GET | /api/orgs | your memberships |
| POST | /api/orgs/switch | set active org for this session |
Common recipes
List today's failed jobs
curl -fsS "https://cronforclaude.com/api/jobs?status=failed&limit=200" \ -H "Authorization: Bearer $CS_KEY" | jq '.[].id'
Trigger a schedule from CI
curl -fsS -X POST https://cronforclaude.com/api/schedules/$SCHED_ID/trigger \ -H "Authorization: Bearer $CS_KEY"
Watch a job to completion
while true; do resp=$(curl -fsS https://cronforclaude.com/api/jobs/$ID -H "Authorization: Bearer $CS_KEY") status=$(echo "$resp" | jq -r .status) echo "[$ID] $status" case "$status" in succeeded|failed|timeout|cancelled) break ;; esac sleep 5 done
Rate limits
100 req/min per key by default. Sign-in / sign-up / password-reset endpoints have tighter buckets (5/min, 3/min, 3/15min). Keys are tied to admin role; member API keys are not a thing yet.