Skip to main content
KiwiFS broadcasts every change in a space over Server-Sent Events (SSE) at 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
Each message has an 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 receive write, 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’ EventSource does this for you.
  • Resync after a gap. Events have no IDs, and KiwiFS ignores Last-Event-ID. After reconnecting, catch up with GET /api/kiwi/changes or 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/kiwi route. The browser EventSource API cannot send an Authorization header, 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 send X-Kiwi-Space. See Multi-space.

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.
Last modified on October 19, 2026