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:
Returns service-level health information including process id, startup time, open file descriptors, and memory usage. Useful for readiness checks and monitoring.
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.
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.
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.
On a successful response, the server returns 200 OK with Content-Type: text/event-stream and begins streaming events. Each event frame contains a JSON-encoded watch_FileEvent payload in the data field. The connection stays open until the client disconnects or the watcher is deleted.
{
"code":"WATCHER_NOT_FOUND",
"message":"Watcher not found",
"details":null
}
Error Code
Title
Description
Resolution
WATCHER_NOT_FOUND
Watcher not found
No watcher exists for provided id
List watchers and use a valid watcher id
{
"code":"HISTORY_GAP",
"message":"Requested since_id is older than available replay history",
"details":null
}
Error Code
Title
Description
Resolution
LIMIT_EXCEEDED
Resource limit exceeded
Watcher or path limits exceeded
Reduce paths or delete unused watchers
HISTORY_GAP
Replay history gap
Requested since_id is older than retained replay history
Reconnect without since_id or increase history_memory_limit_bytes
{
"code":"MAX_CLIENTS_REACHED",
"message":"Watcher has reached max stream clients",
"details":null
}
Error Code
Title
Description
Resolution
MAX_CLIENTS_REACHED
Too many clients
Watcher stream client limit reached
Disconnect idle clients or increase max_clients_per_watcher
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.
On success the server returns 101 Switching Protocols and the connection is upgraded to a WebSocket. Each subsequent text frame contains a JSON-encoded watch_FileEvent payload.
{
"code":"WATCHER_NOT_FOUND",
"message":"Watcher not found",
"details":null
}
Error Code
Title
Description
Resolution
WATCHER_NOT_FOUND
Watcher not found
No watcher exists for provided id
List watchers and use a valid watcher id
{
"code":"HISTORY_GAP",
"message":"Requested since_id is older than available replay history",
"details":null
}
Error Code
Title
Description
Resolution
LIMIT_EXCEEDED
Resource limit exceeded
Watcher or path limits exceeded
Reduce paths or delete unused watchers
HISTORY_GAP
Replay history gap
Requested since_id is older than retained replay history
Reconnect without since_id or increase history_memory_limit_bytes
{
"code":"MAX_CLIENTS_REACHED",
"message":"Watcher has reached max stream clients",
"details":null
}
Error Code
Title
Description
Resolution
MAX_CLIENTS_REACHED
Too many clients
Watcher stream client limit reached
Disconnect idle clients or increase max_clients_per_watcher