GET /api/kiwi/events. The web UI uses this stream to refresh the file tree, open pages, canvases, and boards as soon as anyone edits them. You can subscribe the same way to keep a cache, dashboard, or agent in sync.
SSE is the only real-time transport; there is no WebSocket endpoint. To push changes to a service that cannot hold a connection open, use webhooks.
Subscribe
Terminal
Stream
event: line naming the event type and a data: line of JSON. A :keep-alive comment arrives every 15 seconds so proxies do not close an idle stream.
Event types
Every payload also repeats the event type as
op. Events carry no file content. Compare etag with what you hold, and re-read the file with GET /api/kiwi/file when it differs.
When events fire
File events are sent after the full write pipeline: storage, git commit, index update, then broadcast. When you receivewrite, the new content is already readable and searchable.
The pipeline is shared by every protocol, so writes over REST, MCP, NFS, S3, WebDAV, and FUSE, as well as edits made in an editor on the server’s disk, all produce the same events.
Client guidance
- Reconnect. The stream stays open until either side closes it. Reconnect with backoff when it drops. Browsers’
EventSourcedoes this for you. - Resync after a gap. Events have no IDs, and KiwiFS ignores
Last-Event-ID. After reconnecting, catch up withGET /api/kiwi/changesor by re-reading the files you care about. - Keep up. Each subscriber has a small buffer. A client that reads too slowly misses events instead of slowing the server.
- Authenticate like any other
/api/kiwiroute. The browserEventSourceAPI cannot send anAuthorizationheader, so when auth is on, browser clients need a same-origin proxy that adds it. - Limits. A space accepts up to 256 concurrent subscribers. Beyond that, the endpoint returns
503. - Spaces. Each space has its own stream. Subscribe to
/api/kiwi/{space}/events, or sendX-Kiwi-Space. See Multi-space.
Related
Events API
Endpoint reference.
Webhooks
Signed HTTP POSTs for the same changes.
Agent interface
Every protocol that feeds the pipeline.
Versioning
The commit behind each write event.