Documentation Index
Fetch the complete documentation index at: https://docs.kansato.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Whistle pushes events to URLs you configure in Settings → Developer → Webhooks (outbound from Whistle, inbound to your stack). EachPOST is signed so you can reject forged traffic.
Endpoint URLs and secrets are managed in the dashboard, not through the SDK.
Event types
| Event | When it fires |
|---|---|
report.created | A new report was ingested. |
enforcement.action.created | An enforcement action was recorded against a subject. |
enforcement.action.updated | An existing enforcement action was updated (expiry, metadata). |
enforcement.action.revoked | An enforcement action was revoked or lifted. |
appeal.created | An appeal was submitted against an enforcement action. |
appeal.reviewed | An appeal was reviewed and a decision was made. |
Request envelope
Each delivery body is a JSON object:id— unique event ID. Use for idempotency and deduplication.type— the event name from your subscription.createdAt— ISO 8601 timestamp of when the event occurred.data— event-specific payload.
HTTP headers
Whistle sendsPOST with Content-Type: application/json; charset=utf-8 and:
| Header | Meaning |
|---|---|
x-whistle-event | Event type string. |
x-whistle-event-id | Same as the envelope id. |
x-whistle-delivery-id | Internal delivery row ID (retries reuse the same ID). |
x-whistle-signature | HMAC-SHA256 signature for verification. |
Verifying signatures with the SDK
The SDK providesverifyWebhookSignature to verify incoming webhooks. It parses the signature header, checks the timestamp, computes the HMAC, and returns the typed event.
Next.js App Router
Express
Manual verification
Thex-whistle-signature header has the format:
- Parse the timestamp
tand signaturev1from the header. - Reject if the timestamp is older than your tolerance (recommended: 300 seconds).
- Compute HMAC-SHA256 of the string
<t>.<rawBody>using your signing secret. - Compare the resulting hex digest to
v1using constant-time comparison.
Retries and logs
Failed deliveries retry with backoff. Treatx-whistle-delivery-id (or the envelope id) as your idempotency key so a retried POST does not double-apply side effects.
The View deliveries panel in the dashboard shows status, HTTP status codes, errors, and payload snapshots for recent attempts.
