@karmaniverous/jeeves-runner
    Preparing search index...

    API Reference

    jeeves-runner exposes a Fastify HTTP API for job management and monitoring. Default port: 1937, default bind address: 0.0.0.0.


    Returns service status with version and health metrics.

    Response:

    {
    "name": "runner",
    "version": "0.8.0",
    "uptime": 3661.234,
    "status": "ok",
    "health": {
    "totalJobs": 28,
    "running": 2,
    "failedRegistrations": 0,
    "okLastHour": 45,
    "errorsLastHour": 1
    }
    }
    Field Type Description
    name string Service name ("runner")
    version string Service version (injected at build time)
    uptime number Process uptime in seconds
    status string Service status ("ok")
    health.totalJobs number Total registered jobs
    health.running number Currently executing jobs
    health.failedRegistrations number Jobs that failed cron registration
    health.okLastHour number Successful runs in the last hour
    health.errorsLastHour number Failed/timed-out runs in the last hour

    Query the resolved service configuration. Supports optional JSONPath filtering.

    Query Parameters:

    Parameter Type Default Description
    path string — JSONPath expression to filter config

    Example: GET /config?path=$.port

    Apply a configuration patch to the running service.

    Request Body:

    {
    "patch": { "log": { "level": "debug" } },
    "replace": false
    }
    Field Type Required Description
    patch object Yes Configuration fields to update
    replace boolean No Replace entire config instead of merging (default: false)

    List all jobs with last run status.

    Response:

    {
    "jobs": [
    {
    "id": "sync-email",
    "name": "Sync Email Metadata",
    "schedule": "3 * * * *",
    "script": "/opt/scripts/sync-email.js",
    "type": "script",
    "enabled": 1,
    "timeout_ms": 120000,
    "overlap_policy": "skip",
    "source_type": "path",
    "description": "Sync email metadata from Gmail",
    "on_failure": "C0123456789",
    "on_success": null,
    "output_channel": null,
    "env": null,
    "args": null,
    "last_status": "ok",
    "last_run": "2026-03-02T01:03:00.000Z"
    }
    ]
    }

    Get full details for a single job.

    Response (200):

    {
    "job": {
    "id": "sync-email",
    "name": "Sync Email Metadata",
    "schedule": "3 * * * *",
    "script": "/opt/scripts/sync-email.js",
    "type": "script",
    "enabled": 1,
    "timeout_ms": 120000,
    "overlap_policy": "skip",
    "source_type": "path",
    "description": "Sync email metadata from Gmail",
    "on_failure": "C0123456789",
    "on_success": null,
    "output_channel": null,
    "env": null,
    "args": null
    }
    }

    Response (404):

    {
    "error": "Job not found"
    }

    Get run history for a job.

    Query Parameters:

    Parameter Type Default Description
    limit number 50 Maximum number of runs to return

    Example: GET /jobs/sync-email/runs?limit=10

    Response:

    {
    "runs": [
    {
    "id": 42,
    "job_id": "sync-email",
    "status": "ok",
    "started_at": "2026-03-02T01:03:00.000Z",
    "finished_at": "2026-03-02T01:03:12.345Z",
    "duration_ms": 12345,
    "exit_code": 0,
    "tokens": null,
    "result_meta": null,
    "error": null,
    "stdout_tail": "Synced 15 messages",
    "stderr_tail": "",
    "trigger": "schedule"
    }
    ]
    }

    Manually trigger a job run. Blocks until the job completes.

    Response (200):

    {
    "result": {
    "status": "ok",
    "exit_code": 0,
    "duration_ms": 5432,
    "stdout": "Done",
    "stderr": ""
    }
    }

    Response (404):

    {
    "error": "Job 'nonexistent' not found"
    }

    Create a new job. See the CLI Reference for field descriptions.

    Response (201):

    {
    "ok": true,
    "id": "my-job"
    }

    Partial update of an existing job. Only supplied fields are changed.

    Response (200):

    {
    "ok": true
    }

    Delete a job and all its run history.

    Response (200):

    {
    "ok": true
    }

    Enable a disabled job. Takes effect immediately (triggers reconciliation).

    Response (200):

    {
    "ok": true
    }

    Disable a job. The job will not run until re-enabled.

    Response (200):

    {
    "ok": true
    }

    Update a job's script content or path without changing other fields.

    Response (200):

    {
    "ok": true
    }

    List all queue names.

    Response:

    {
    "queues": ["email-updates", "notifications"]
    }

    Queue depth, claimed count, failed count, and oldest pending age.

    Response:

    {
    "depth": 5,
    "claimedCount": 2,
    "failedCount": 1,
    "oldestAge": 30000
    }
    Field Type Description
    depth number Total pending items
    claimedCount number Items currently being processed
    failedCount number Items in failed state
    oldestAge number | null Age of oldest pending item in ms (null if empty)

    Non-claiming read of pending items.

    Query Parameters:

    Parameter Type Default Description
    limit number 10 Maximum items to return

    Response:

    {
    "items": [
    {
    "id": 1,
    "payload": { "threadId": "abc123" },
    "priority": 0,
    "createdAt": "2026-03-02T01:00:00.000Z"
    }
    ]
    }

    List all state namespaces.

    Response:

    {
    "namespaces": ["email", "github"]
    }

    Read scalar state for a namespace as a key-value map. Supports optional ?path= JSONPath filtering.

    Response:

    {
    "lastRunAt": "2026-03-02T01:03:00.000Z",
    "cursor": null
    }

    Read a scalar value and its collection items. Supports optional ?path= JSONPath filtering.

    Response:

    {
    "value": "parent-value",
    "items": [
    {
    "itemKey": "thread-123",
    "value": "seen",
    "updatedAt": "2026-03-02T01:00:00.000Z"
    }
    ],
    "count": 1
    }