Webhooks and Real-time Events
Klau Webhooks allow you to receive real-time notifications about events in your haulers' lifecycle. Instead of polling the API, Klau will push data to your server as it happens.
Security (Verifying Signatures)
To ensure that a webhook request genuinely came from Klau, every request includes a Klau-Signature header.
Klau-Signature: t=1734567890,v1=6a2f...Verify signatures by calculating an HMAC SHA-256 of the timestamp and payload using your secret.
Delivery Guarantees
- Transactional Outbox: Events are saved to our database in the same transaction as the change.
- Exponential Backoff: If your server returns a non-2xx status, we retry for up to 24 hours.
- Guaranteed Delivery: We guarantee at least-once delivery of all events.
Common Event Types
| Event | Description |
|---|---|
| job.completed | Job finished. Includes final photo evidence URLs. |
| driver.delayed | Driver is significantly behind schedule. |
| dispatch.optimized | A new optimized plan has been generated. |
Idempotency in Webhooks
Since we guarantee at least once delivery, your server might receive the same event twice. Always check the id field in the event payload to ensure you don't process it multiple times.