Documentation Index
Fetch the complete documentation index at: https://docs.kavachos.com/llms.txt
Use this file to discover all available pages before exploring further.
What webhooks do
Webhooks push signed HTTP POST requests to a URL you control whenever a KavachOS auth event occurs. Use them to sync user records, trigger onboarding flows, alert on suspicious logins, or feed events into your analytics pipeline.Setup
Subscribing to events
Each endpoint subscribes to one or more event types. Use'*' to receive all events.
Event reference
| Event | Fired when |
|---|---|
user.created | A new human user registers |
user.deleted | A user account is deleted |
auth.login | A successful login occurs |
auth.logout | A session is terminated |
auth.failed | A login attempt fails |
agent.created | A new agent identity is created |
agent.revoked | An agent is revoked |
delegation.granted | An agent receives a delegation grant |
delegation.revoked | A delegation grant is removed |
approval.requested | A human approval request is opened |
approval.resolved | An approval request is approved or denied |
Request headers
Every webhook delivery includes these headers:| Header | Value |
|---|---|
X-Kavach-Signature | sha256=<hmac>. HMAC-SHA256 of the raw body |
X-Kavach-Event | Event type, e.g. user.created |
X-Kavach-Delivery | Unique UUID for this delivery attempt |
X-Kavach-Timestamp | Unix timestamp (seconds) of delivery |
Verifying signatures
Always verify the signature before trusting the payload.- Node
- Edge (Web Crypto)
Retry behavior
If your endpoint returns a non-2xx status or times out, KavachOS retries the delivery three times with exponential backoff:| Attempt | Delay |
|---|---|
| 1 | 30 seconds |
| 2 | 5 minutes |
| 3 | 30 minutes |
failed and no further retries occur.
Testing a webhook URL
Use thekavach.webhooks.test() method to send a synthetic ping event to any registered endpoint:
{ event: 'ping', timestamp: '...' } and respects the same signing and retry logic as real events.
Next steps
Lifecycle hooks
Run async callbacks on auth events inside the SDK process.
Audit log
Query the full record of every authorization decision.