The difference between a hobbyist webhook system and a production one is signing, retries, and a DLQ. Here's how unLocked CRM ships all three out of the box.
Key Takeaways
- HMAC-SHA256 signed webhooks in Stripe t=…,v1=… format
- Exponential retry ladder: 1m → 5m → 30m → 1h → 3h → 6h
- Dead-letter queue with dashboard replay
- pg_cron-coordinated worker — durable across deploys
Webhook security is one of the most under-discussed parts of an insurance CRM's API. PII flows through these payloads — names, dates of birth, plan IDs, sometimes premium amounts — and a webhook receiver that can't verify the sender is a phishing target waiting to be exploited.
HMAC-SHA256 Signing, Stripe-Style
Every unLocked webhook ships with a header in the form t=1714000000,v1=<hex>. Your endpoint computes HMAC-SHA256(timestamp + "." + raw_body, shared_secret) and constant-time compares it to v1. If it matches and the timestamp is fresh (typically within 5 minutes), the request is authentic. This is the same pattern Stripe popularized and is now table-stakes for production webhook systems.
Exponential-Backoff Retries
Network glitches, deploys, brief downtime — receivers fail. unLocked retries on a ladder: 1 minute, 5 minutes, 30 minutes, 1 hour, 3 hours, 6 hours. After 6 failed attempts, the delivery moves to the dead-letter queue, where it can be replayed from the dashboard once the underlying issue is fixed.
The pg_cron Retry Worker
Retries are coordinated by a webhook-retry-worker Edge Function scheduled by pg_cron. Workloads are idempotent and durable across deploys — there is no in-memory queue to lose on restart.
Why Insurance Especially
Carrier feeds, commission statements, application status updates — all of these arrive asynchronously and downstream systems (AMS, accounting, agent dashboards) can't tolerate silent drops. Signed + retried + DLQ'd webhooks are the only architecture that holds up under audit.
Where This Fits In unLocked
- best CRM for insurance agents: How insurance CRMs compare on quoting, commissions, AI and price.