Skip to main content

List All Jobs

GET /api/watch/jobs Retrieve all watched directories (active and inactive).
cURL
curl http://localhost:60534/api/watch/jobs

Response

200 Success
{
  "jobs": [
    {
      "id": 1,
      "path": "/Users/username/Downloads",
      "is_active": true,
      "recursive": true,
      "file_pattern": null,
      "last_scan": "2025-01-15T10:30:00",
      "created_at": "2025-01-15T10:30:00",
      "updated_at": "2025-01-15T14:22:00"
    }
  ]
}

Job Fields

id
number
Unique job identifier
path
string
Absolute path to the watched directory
is_active
boolean
Whether the job is currently active
recursive
boolean
Whether subdirectories are watched
file_pattern
string | null
Optional glob pattern filter (e.g. "*.pdf")
last_scan
string | null
ISO 8601 timestamp of the last scan
created_at
string | null
ISO 8601 timestamp when the job was created
updated_at
string | null
ISO 8601 timestamp when the job was last updated

Delete Job

DELETE /api/watch/jobs/{job_id} Stop watching a directory and remove all indexed files for it.
cURL
curl -X DELETE http://localhost:60534/api/watch/jobs/1

Response

200 Success
{
  "success": true,
  "message": "Successfully deleted watched directory: /Users/username/Downloads",
  "job_id": 1
}
404 Not Found
{
  "success": false,
  "message": "Watched directory with ID 99 not found",
  "job_id": 99
}
This will:
  1. Stop the active watcher job (if running)
  2. Delete all indexed files for this directory from the database
  3. Remove the watched directory record