Skip to content

The Schedule Management API lets you list every registered @schedule directive, trigger an immediate fire, reload registrations from disk, and inspect the recent fire history recorded in fires.log. Use these endpoints to operationalize cron-style workloads in Hoody — for example, to surface upcoming jobs in dashboards, run one-off ad-hoc fires for testing, or recover after editing @schedule directives without restarting the worker.

Returns every currently registered @schedule directive with computed next-fire timestamps and last-fire metadata.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.example.com/api/v1/exec/schedules/list \
-H "Authorization: Bearer <token>"

Reads newest-first NDJSON entries from fires.log, returning per-fire completion records with status, duration, and error previews.

NameInTypeRequiredDescription
scriptPathquerystringNoFilter entries to a specific script (relative to scripts-dir). Optional.
sincequerystringNoISO 8601 lower bound on ts. Optional.
limitqueryintegerNoMax entries to return. Default 100, hard max 1000.
includeRotatedquerybooleanNoWhen true, also scan rotated fires.log.* files (slower).
Terminal window
curl -X GET "https://api.example.com/api/v1/exec/schedules/history?scriptPath=default/jobs/cleanup.ts&limit=50" \
-H "Authorization: Bearer <token>"

Re-scans the scripts directory and reconciles the live schedule registry against the current filesystem. Returns a diff describing what was added, kept, removed, and failed.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
dry_runbooleanNofalseWhen true, compute the diff against the filesystem but do not apply. Returns the same shape with added, kept, and removed lists.
Terminal window
curl -X POST https://api.example.com/api/v1/exec/schedules/reload \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "dry_run": true }'

Fires a registered @schedule script immediately, returning the outcome without waiting for the next cron tick.

This endpoint takes no parameters.

FieldTypeRequiredDescription
scriptPathstringYesScript path (absolute or relative to scripts-dir) of a script with a valid @schedule directive.
forcebooleanNoWhen true, bypass the @token refusal. Use with care — this fires the script as cron (no token auth).
Terminal window
curl -X POST https://api.example.com/api/v1/exec/schedules/trigger \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "scriptPath": "default/jobs/cleanup.ts" }'