The file system watcher API lets you create long-running watchers that observe file and directory changes inside a container and deliver events to clients in real time. Use these endpoints to register watchers, inspect their configuration and statistics, replay a recent history of events, or consume a live stream over Server-Sent Events (SSE) or WebSocket.
All endpoints in this section are served from the per-container watch service host:
https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com
Replace {projectId}, {containerId}, and {server} with the target values for your container.
Returns the operational status of the watch service. Use this endpoint to verify that the service is reachable and to inspect runtime information such as the process id, start time, and resource usage.
This endpoint takes no parameters.
" started " : " 2026-02-11T15:30:00Z " ,
" built " : " 2026-02-10T12:00:00Z " ,
" userAgent " : " HoodyClient/1.0 "
curl -X GET " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/api/v1/watch/health " \
-H " Authorization: Bearer <token> "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . health . check ();
A watcher is a registered configuration that observes one or more paths and emits events. The endpoints in this section manage the lifecycle of a watcher.
Creates a new watcher with the supplied configuration. The watcher begins emitting events as soon as it is created. The body conforms to the watch_CreateWatcherRequest schema; refer to that schema for the authoritative list of supported fields.
This endpoint takes no parameters.
" paths " : [ " /home/user/projects/app/src " ],
" kinds " : [ " created " , " modified " , " removed " , " renamed " ],
" exclude " : [ " **/*.test.ts " ],
" ignore_dirs " : [ " node_modules " , " .git " ],
" id " : " c1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
" created_at " : " 2026-02-11T15:30:00Z " ,
" paths " : [ " /home/user/projects/app/src " ],
" exclude " : [ " **/*.test.ts " ],
" ignore_dirs " : [ " node_modules " , " .git " ],
" kinds " : [ " created " , " modified " , " removed " , " renamed " ],
" history_limit_bytes " : 1048576
" code " : " INVALID_REQUEST " ,
" message " : " path list cannot be empty "
Error Code Title Description Resolution INVALID_REQUESTInvalid request Request payload failed validation Check request fields and retry INVALID_PAGINATIONInvalid pagination Page or limit is out of range Use page >= 1 and limit between 1 and 200
" code " : " LIMIT_EXCEEDED " ,
" message " : " watcher limit reached "
Error Code Title Description Resolution LIMIT_EXCEEDEDResource limit exceeded Watcher or path limits exceeded Reduce paths or delete unused watchers HISTORY_GAPReplay history gap Requested since_id is older than retained replay history Reconnect without since_id or increase history_memory_limit_bytes
" code " : " WATCHER_START_FAILED " ,
" message " : " failed to start watcher: ... "
Error Code Title Description Resolution WATCHER_START_FAILEDWatcher startup failed Backend failed to initialize file watcher Check path permissions and kernel watch limits
curl -X POST " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers " \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"paths": ["/home/user/projects/app/src"],
"kinds": ["created", "modified", "removed", "renamed"],
"exclude": ["**/*.test.ts"],
"ignore_dirs": ["node_modules", ".git"],
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . watchers . create ({
paths : [ ' /home/user/projects/app/src ' ],
kinds : [ ' created ' , ' modified ' , ' removed ' , ' renamed ' ],
exclude : [ ' **/*.test.ts ' ],
ignore_dirs : [ ' node_modules ' , ' .git ' ],
Returns a paginated list of all watchers registered on the container.
Name In Type Required Description pagequery integer No Page number (1-based). limitquery integer No Items per page (1-200).
" id " : " c1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
" created_at " : " 2026-02-11T15:30:00Z " ,
" paths " : [ " /home/user/projects/app/src " ],
" exclude " : [ " **/*.test.ts " ],
" ignore_dirs " : [ " node_modules " , " .git " ],
" kinds " : [ " created " , " modified " , " removed " , " renamed " ],
" history_limit_bytes " : 1048576
" code " : " INVALID_PAGINATION " ,
" message " : " Limit must be between 1 and 200 "
Error Code Title Description Resolution INVALID_REQUESTInvalid request Request payload failed validation Check request fields and retry INVALID_PAGINATIONInvalid pagination Page or limit is out of range Use page >= 1 and limit between 1 and 200
curl -X GET " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers?page=1&limit=20 " \
-H " Authorization: Bearer <token> "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . watchers . listIterator ({ page : 1 , limit : 20 });
Returns the configuration, creation timestamp, and runtime statistics for a single watcher.
Name In Type Required Description idpath string Yes Watcher id
" id " : " c1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
" created_at " : " 2026-02-11T15:30:00Z " ,
" paths " : [ " /home/user/projects/app/src " ],
" exclude " : [ " **/*.test.ts " ],
" ignore_dirs " : [ " node_modules " , " .git " ],
" kinds " : [ " created " , " modified " , " removed " , " renamed " ],
" history_limit_bytes " : 1048576
" code " : " WATCHER_NOT_FOUND " ,
" message " : " Watcher not found "
Error Code Title Description Resolution WATCHER_NOT_FOUNDWatcher not found No watcher exists for provided id List watchers and use a valid watcher id
curl -X GET " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers/c1b2c3d4-e5f6-7890-abcd-ef1234567890 " \
-H " Authorization: Bearer <token> "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . watchers . get ( ' c1b2c3d4-e5f6-7890-abcd-ef1234567890 ' );
Stops the watcher and releases its underlying resources. Any active SSE or WebSocket clients connected to the watcher are closed.
Name In Type Required Description idpath string Yes Watcher id
" id " : " c1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
" code " : " WATCHER_NOT_FOUND " ,
" message " : " Watcher not found "
Error Code Title Description Resolution WATCHER_NOT_FOUNDWatcher not found No watcher exists for provided id List watchers and use a valid watcher id
curl -X DELETE " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers/c1b2c3d4-e5f6-7890-abcd-ef1234567890 " \
-H " Authorization: Bearer <token> "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . watchers . delete ( ' c1b2c3d4-e5f6-7890-abcd-ef1234567890 ' );
These endpoints expose the events a watcher has observed. Use the paginated history endpoint to catch up on missed events, the SSE endpoint for simple streaming, or the WebSocket endpoint for full-duplex communication.
Returns a paginated history of events recorded by the watcher. Use since_id or since_timestamp to replay events that occurred after a known point.
Name In Type Required Description idpath string Yes Watcher id since_idquery integer No Replay events strictly after this event id. since_timestampquery string No Replay events strictly after this timestamp. Accepted formats: RFC3339 (e.g. 2026-02-11T15:30:00Z), Unix seconds (e.g. 1739287800), Unix milliseconds (e.g. 1739287800123). pagequery integer No Page number (1-based). limitquery integer No Items per page (1-200).
" watcher_id " : " c1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
" path " : " /home/user/projects/app/src/index.ts " ,
" timestamp " : " 2026-02-11T15:31:00Z " ,
" watcher_id " : " c1b2c3d4-e5f6-7890-abcd-ef1234567890 " ,
" path " : " /home/user/projects/app/src/utils.ts " ,
" timestamp " : " 2026-02-11T15:32:00Z " ,
" oldest_available_id " : 1 ,
" oldest_available_timestamp " : " 2026-02-11T15:31:00Z " ,
" newest_available_id " : 2 ,
" newest_available_timestamp " : " 2026-02-11T15:32:00Z "
" code " : " INVALID_REQUEST " ,
" message " : " path list cannot be empty "
Error Code Title Description Resolution INVALID_REQUESTInvalid request Request payload failed validation Check request fields and retry INVALID_PAGINATIONInvalid pagination Page or limit is out of range Use page >= 1 and limit between 1 and 200
" code " : " WATCHER_NOT_FOUND " ,
" message " : " Watcher not found "
Error Code Title Description Resolution WATCHER_NOT_FOUNDWatcher not found No watcher exists for provided id List watchers and use a valid watcher id
" message " : " Requested since_id is older than available replay history "
Error Code Title Description Resolution LIMIT_EXCEEDEDResource limit exceeded Watcher or path limits exceeded Reduce paths or delete unused watchers HISTORY_GAPReplay history gap Requested since_id is older than retained replay history Reconnect without since_id or increase history_memory_limit_bytes
curl -X GET " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers/c1b2c3d4-e5f6-7890-abcd-ef1234567890/events?page=1&limit=20 " \
-H " Authorization: Bearer <token> "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . streams . listEventsIterator ( ' c1b2c3d4-e5f6-7890-abcd-ef1234567890 ' , { page : 1 , limit : 20 });
Opens a Server-Sent Events stream of watcher events. The response is a long-lived text/event-stream connection. Each event is delivered as a JSON payload on the data line. Use since_id or since_timestamp to replay events that occurred after a known point before live streaming begins.
Name In Type Required Description idpath string Yes Watcher id since_idquery integer No Replay events strictly after this event id. since_timestampquery string No Replay events strictly after this timestamp. Accepted formats: RFC3339 (e.g. 2026-02-11T15:30:00Z), Unix seconds (e.g. 1739287800), Unix milliseconds (e.g. 1739287800123).
Content-Type: text/event-stream
data: {"id":1,"watcher_id":"c1b2c3d4-e5f6-7890-abcd-ef1234567890","kind":"modified","path":"/home/user/projects/app/src/index.ts","timestamp":"2026-02-11T15:31:00Z","is_dir":false,"old_size_bytes":1024,"new_size_bytes":1280}
data: {"id":2,"watcher_id":"c1b2c3d4-e5f6-7890-abcd-ef1234567890","kind":"created","path":"/home/user/projects/app/src/utils.ts","timestamp":"2026-02-11T15:32:00Z","is_dir":false,"new_size_bytes":256}
" code " : " WATCHER_NOT_FOUND " ,
" message " : " Watcher not found "
Error Code Title Description Resolution WATCHER_NOT_FOUNDWatcher not found No watcher exists for provided id List watchers and use a valid watcher id
" message " : " Requested since_id is older than available replay history "
Error Code Title Description Resolution LIMIT_EXCEEDEDResource limit exceeded Watcher or path limits exceeded Reduce paths or delete unused watchers HISTORY_GAPReplay 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 "
Error Code Title Description Resolution MAX_CLIENTS_REACHEDToo many clients Watcher stream client limit reached Disconnect idle clients or increase max_clients_per_watcher
curl -N -X GET " https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers/c1b2c3d4-e5f6-7890-abcd-ef1234567890/events/sse " \
-H " Authorization: Bearer <token> " \
-H " Accept: text/event-stream "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . streams . streamSse ( ' c1b2c3d4-e5f6-7890-abcd-ef1234567890 ' );
Upgrades the HTTP connection to a WebSocket and streams watcher events as text frames containing JSON payloads. Use since_id or since_timestamp to replay events that occurred after a known point before live streaming begins.
Name In Type Required Description idpath string Yes Watcher id since_idquery integer No Replay events strictly after this event id. since_timestampquery string No Replay events strictly after this timestamp. Accepted formats: RFC3339 (e.g. 2026-02-11T15:30:00Z), Unix seconds (e.g. 1739287800), Unix milliseconds (e.g. 1739287800123).
HTTP/1.1 101 Switching Protocols
" code " : " WATCHER_NOT_FOUND " ,
" message " : " Watcher not found "
Error Code Title Description Resolution WATCHER_NOT_FOUNDWatcher not found No watcher exists for provided id List watchers and use a valid watcher id
" message " : " Requested since_id is older than available replay history "
Error Code Title Description Resolution LIMIT_EXCEEDEDResource limit exceeded Watcher or path limits exceeded Reduce paths or delete unused watchers HISTORY_GAPReplay 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 "
Error Code Title Description Resolution MAX_CLIENTS_REACHEDToo many clients Watcher stream client limit reached Disconnect idle clients or increase max_clients_per_watcher
-H " Authorization: Bearer <token> " \
-H " Connection: Upgrade " \
-H " Upgrade: websocket " \
-H " Sec-WebSocket-Version: 13 " \
-H " Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== " \
" https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com/watchers/c1b2c3d4-e5f6-7890-abcd-ef1234567890/events/ws "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-watch-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . watch . streams . streamWs ( ' c1b2c3d4-e5f6-7890-abcd-ef1234567890 ' );