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
- REST
- config.toml
Terminal
201 Created
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 aPOST 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.
webhook-timestamp is more than a few minutes old to block replays.
Delivery and retries
- Your endpoint must answer with a
2xxstatus 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.Related
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.