Skip to main content
Webhooks push change events from KiwiFS to your own services. Register a URL with a path glob, and KiwiFS POSTs a signed JSON payload every time a matching page changes. Use them to trigger CI, sync a search index, post to chat, or wake an agent. Webhooks fire for every write that goes through the pipeline: REST, MCP, NFS, S3, WebDAV, FUSE, imports, and edits made directly on disk. For a live stream inside a browser or long-running client, use real-time events instead.

Enable webhooks

Webhooks are off by default.
.kiwi/config.toml
Restart the server after changing these keys. Registered webhooks are stored in .kiwi/state/webhooks.db.

Register a webhook

Terminal
201 Created
The API returns the secret only in the create response. List responses omit it. Store it when you register the webhook.
url and path_glob are required. event_types is optional; leave it out to receive every event type.

Path globs

Paths are relative to the knowledge root, with no leading slash. ** works on its own or as a trailing /**. Any other pattern uses shell-style matching where * does not cross /.

Event types

Payload

Each delivery is a POST with a JSON body.
write
transition
The payload carries no file content. Fetch the page with GET /api/kiwi/file if you need it.

Verify signatures

Every delivery carries Standard Webhooks headers plus a simpler body signature. The HMAC key is the secret string itself, including the whsec_ prefix. If a secret you set in config is valid standard base64, KiwiFS decodes it and uses the bytes instead.
Off-the-shelf Standard Webhooks libraries strip whsec_ and base64-decode the rest, which does not match generated KiwiFS secrets. Verify with your own HMAC, as below.
Reject deliveries whose webhook-timestamp is more than a few minutes old to block replays.

Delivery and retries

  • Your endpoint must answer with a 2xx status within 30 seconds. Anything else counts as a failure.
  • Failed deliveries retry after 5 seconds, 30 seconds, 2 minutes, 15 minutes, and 1 hour, then hourly, up to max_retries.
  • Deliveries are queued in memory. Up to 256 can wait; when the queue is full, new events are dropped and logged. Pending retries do not survive a restart.
  • Deliveries can arrive out of order and more than once. Key your handler on webhook-id, and re-read the file rather than trusting event order.

Manage webhooks

Terminal
kiwifs export --webhook <url> sends a separate, one-off export.completed notification when an export finishes. It is signed the same way when you pass --webhook-secret or a matching [[webhook_entries]] secret. See Export.

Webhooks REST API

Register, list, and delete webhooks.

Real-time events

Live SSE stream of the same changes.

Workflows

State changes that send transition events.

Configuration

The [webhooks] section.
Last modified on October 19, 2026