What is a webhook?
A user-defined HTTP callback, your URL gets POSTed to whenever an event happens in someone else's system, instead of you polling for changes.
Webhooks invert the API direction. Instead of your code asking the service "anything new?" every minute, you give the service a URL, and it POSTs to that URL the moment something happens. Stripe's charge.succeeded, GitHub's push, Slack's message, every modern SaaS's "event delivered" flow, all webhooks.
Receiving webhooks well is harder than it looks. You need to verify the signature header to confirm the payload is real, return 2xx fast (long-running work goes to a background queue), tolerate duplicate deliveries (the sender retries on non-2xx), and handle out-of-order events (don't assume the timeline matches your DB state).
Sending webhooks well is also non-trivial: durable queues, exponential retries with a max attempt count, signed payloads, per-customer dead letter queues, and an admin UI for replays. Most teams underestimate how much of webhook infrastructure is on the sender side.
In the wild
- Stripe POSTing
payment_intent.succeededto your/webhooks/stripeendpoint - GitHub POSTing
pushevents to your CI server - Context.dev POSTing a signed monitor event to your endpoint when a watched page changes