The schedule management endpoints let you inspect, trigger, and refresh @schedule directives registered by the exec runtime. Use these to audit active cron jobs, review historical fires, reload registrations after script changes, and trigger an immediate fire for testing or recovery.
Returns every currently registered @schedule directive, with the computed next fire time and the most recent fire outcome for each.
This endpoint takes no parameters.
curl -X GET " https://api.example.com/api/v1/exec/schedules/list " \
-H " Authorization: Bearer <token> "
const result = await client . exec . schedules . listSchedules ();
"scriptPath" : " /srv/scripts/default/cron/cleanup.ts " ,
"scriptRel" : " default/cron/cleanup.ts " ,
"vmCacheKey" : " default:default/cron/cleanup.ts " ,
"expression" : " 0 * * * * " ,
"registeredAt" : " 2026-01-01T00:00:00.000Z " ,
"nextFire" : " 2026-01-15T13:00:00.000Z " ,
"lastFireAt" : " 2026-01-15T12:00:00.000Z " ,
"lastFireRunId" : " a1b2c3d4-e5f6-7890-abcd-ef1234567890 "
"error" : " Invalid parameter format " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"error" : " Internal server error " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
"error" : " Service unavailable " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Returns newest-first NDJSON entries from the fires log. Use the query parameters to narrow the window to a specific script or a time range, and to opt into scanning rotated log files.
Name In Type Required Description scriptPathquery string No Filter entries to a specific script (relative to scripts-dir). sincequery string No ISO 8601 lower bound on ts. limitquery integer No Max entries to return. Default 100, hard max 1000. includeRotatedquery boolean No When true, also scan rotated fires.log.* files (slower). Default false.
curl -X GET " https://api.example.com/api/v1/exec/schedules/history?scriptPath=default/cron/cleanup.ts&limit=50 " \
-H " Authorization: Bearer <token> "
const history = await client . exec . schedules . scheduleHistory ( {
scriptPath: " default/cron/cleanup.ts " ,
since: " 2026-01-15T00:00:00Z " ,
"ts" : " 2026-01-15T12:00:00.000Z " ,
"scriptPath" : " default/cron/cleanup.ts " ,
"expression" : " 0 * * * * " ,
"runId" : " a1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
"returnPreview" : " { \" deleted \" :12} "
"ts" : " 2026-01-15T11:00:00.000Z " ,
"scriptPath" : " default/cron/cleanup.ts " ,
"expression" : " 0 * * * * " ,
"runId" : " b2c3d4e5-f6a7-8901-bcde-f12345678901 " ,
"error" : " TypeError: cannot read property 'id' of undefined "
"error" : " Invalid parameter format " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"error" : " Internal server error " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
"error" : " Service unavailable " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Rescans the scripts directory and reconciles the registered schedules against the current filesystem contents. Pass dry_run: true to preview the diff (added, kept, removed) without applying it.
This endpoint takes no query, path, or header parameters.
Name Type Required Default Description dry_runboolean No falseWhen true, compute the diff against the filesystem but do not apply. Returns the same shape with added, kept, removed lists.
curl -X POST " https://api.example.com/api/v1/exec/schedules/reload " \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
const result = await client . exec . schedules . reloadSchedules ( {
"added" : [ " default/cron/new-job.ts " ],
"kept" : [ " default/cron/cleanup.ts " ],
"removed" : [ " default/cron/deprecated.ts " ],
"path" : " default/cron/broken.ts " ,
"reason" : " Invalid cron expression: 'every blue moon' "
"error" : " Invalid parameter format " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"error" : " Internal server error " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
"error" : " Service unavailable " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Note
The failed array is populated in both dry_run and apply responses, so you can surface registration problems (bad cron expression, @websocket combined with @schedule, preflight compile errors) before committing a reload.
Manually fires a registered schedule once. Useful for replaying a missed fire or testing a cron expression outside its natural cadence.
This endpoint takes no query, path, or header parameters.
Name Type Required Default Description scriptPathstring Yes — Script path (absolute or relative to scripts-dir) of a script with a valid @schedule directive. forceboolean No falseWhen true, bypass the @token refusal. Use with care — this fires the script as cron (no token auth).
curl -X POST " https://api.example.com/api/v1/exec/schedules/trigger " \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"scriptPath": "default/cron/cleanup.ts", "force": false} '
const result = await client . exec . schedules . triggerSchedule ( {
scriptPath: " default/cron/cleanup.ts " ,
"scriptPath" : " default/cron/cleanup.ts " ,
"runId" : " c3d4e5f6-a7b8-9012-cdef-123456789012 " ,
"error" : " Invalid parameter format " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
"error" : " Access denied " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
"error" : " Resource not found " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
"error" : " Internal server error " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "
"error" : " Service unavailable " ,
"timestamp" : " 2026-01-15T12:00:00.000Z "