Skip to content
Hoody.com

The File System Watchers API lets you create per-path watchers that emit real-time file system events. Each watcher maintains an in-memory replay history and supports streaming events to clients over Server-Sent Events (SSE) or WebSocket.

All endpoints are served from a per-container subdomain. The base URL has the form:

https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu

Replace {projectId}, {containerId}, and {server} with the appropriate values from your environment before issuing requests.

Returns service-level health information including process id, startup time, open file descriptors, and memory usage. Useful for readiness checks and monitoring.

Terminal window
curl -X GET "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/api/v1/watch/health" \
-H "Authorization: Bearer <token>"

A watcher is a long-lived configuration that subscribes to one or more filesystem paths and produces events. The endpoints in this section manage watcher lifecycle.

Creates a new watcher and starts it in the background. The request body describes the paths to monitor and optional filtering or coalescing parameters.

This endpoint takes no path or query parameters.

The request body is passed to the SDK as a single object argument.

Terminal window
curl -X POST "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}'

Returns a paginated list of all watchers on the container. Use the page and limit query parameters to control pagination.

NameInTypeRequiredDescription
pagequeryintegerNoPage number (1-based).
limitqueryintegerNoItems per page (1-200).
Terminal window
curl -X GET "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers?page=1&limit=20" \
-H "Authorization: Bearer <token>"

Returns details for a single watcher, including its current configuration and runtime statistics.

NameInTypeRequiredDescription
idpathstringYesWatcher id
Terminal window
curl -X GET "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers/f1c2a3b4-5d6e-7f8a-9b0c-1d2e3f4a5b6c" \
-H "Authorization: Bearer <token>"

Stops the watcher and removes it. Any active stream clients are disconnected.

NameInTypeRequiredDescription
idpathstringYesWatcher id
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers/f1c2a3b4-5d6e-7f8a-9b0c-1d2e3f4a5b6c" \
-H "Authorization: Bearer <token>"

Once a watcher exists you can read its event history over HTTP, or subscribe to a real-time stream via SSE or WebSocket. All three endpoints accept the same since_id and since_timestamp parameters for replay semantics — events strictly newer than the supplied cursor are returned or delivered.

Returns a paginated page of historical events for the watcher. Each item is a watch_FileEvent with a monotonic event id, a kind, and the affected path.

NameInTypeRequiredDescription
idpathstringYesWatcher id
since_idqueryintegerNoReplay events strictly after this event id.
since_timestampquerystringNoReplay events strictly after this timestamp. Accepted formats: RFC3339 (e.g. 2026-02-11T15:30:00Z), Unix seconds (e.g. 1739287800), or Unix milliseconds (e.g. 1739287800123).
pagequeryintegerNoPage number (1-based).
limitqueryintegerNoItems per page (1-200).
Terminal window
curl -X GET "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers/f1c2a3b4-5d6e-7f8a-9b0c-1d2e3f4a5b6c/events?page=1&limit=50" \
-H "Authorization: Bearer <token>"

Opens a Server-Sent Events stream for the watcher. The connection stays open and pushes new watch_FileEvent payloads as they occur. Optionally pass since_id or since_timestamp to first replay retained history before switching to live delivery.

NameInTypeRequiredDescription
idpathstringYesWatcher id
since_idqueryintegerNoReplay events strictly after this event id.
since_timestampquerystringNoReplay events strictly after this timestamp. Accepted formats: RFC3339 (e.g. 2026-02-11T15:30:00Z), Unix seconds (e.g. 1739287800), or Unix milliseconds (e.g. 1739287800123).
Terminal window
curl -N -X GET "https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers/f1c2a3b4-5d6e-7f8a-9b0c-1d2e3f4a5b6c/events/sse" \
-H "Authorization: Bearer <token>" \
-H "Accept: text/event-stream"

Upgrades the HTTP connection to a WebSocket and streams events as text frames. As with the SSE endpoint, since_id and since_timestamp can be supplied to replay retained history before live delivery.

NameInTypeRequiredDescription
idpathstringYesWatcher id
since_idqueryintegerNoReplay events strictly after this event id.
since_timestampquerystringNoReplay events strictly after this timestamp. Accepted formats: RFC3339 (e.g. 2026-02-11T15:30:00Z), Unix seconds (e.g. 1739287800), or Unix milliseconds (e.g. 1739287800123).
Terminal window
curl -N -i \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
"https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.icu/watchers/f1c2a3b4-5d6e-7f8a-9b0c-1d2e3f4a5b6c/events/ws?since_id=1024"