Webhooks Explained

Event-driven HTTP callbacks that let applications push data to each other in real time, replacing wasteful polling with instant notifications.

Webhooks

Webhooks are user-defined HTTP callbacks that notify external systems in real time when specific events occur, enabling applications to push data to each other rather than requiring polling.

Explanation

Without webhooks, integrating two systems requires polling: System A repeatedly asks System B "did anything change?" — wasting bandwidth and introducing latency. Webhooks reverse this: System B proactively sends an HTTP POST request to System A's callback URL whenever a relevant event occurs (e.g., payment completed, pull request merged, form submitted). A webhook payload typically contains the event type, a timestamp, and the relevant data as JSON. The receiving endpoint should respond with a 2xx status code to acknowledge receipt. If the receiver is down or returns an error, the sender retries with exponential backoff. Idempotency is critical — the same event may be delivered multiple times, so receivers must handle duplicates gracefully. Security considerations include verifying webhook signatures (the sender signs the payload with a shared secret, and the receiver validates the signature), using HTTPS endpoints, and implementing request timeouts. Popular services that use webhooks include Stripe (payment events), GitHub (repository events), Twilio (messaging events), and Slack (bot interactions).

Bookuvai Implementation

Bookuvai implements webhook infrastructure for both sending and receiving. Outgoing webhooks include HMAC signature verification, automatic retries with exponential backoff, and delivery logging. Incoming webhook endpoints validate signatures, check timestamps to prevent replay attacks, and process events idempotently. Our webhook dashboard shows delivery status and enables manual retry.

Key Facts

  • Webhooks push data in real time, eliminating the need for polling
  • HMAC signature verification ensures webhook authenticity
  • Retry with exponential backoff handles temporary receiver failures
  • Idempotent processing prevents duplicate event handling
  • Webhooks are the standard integration pattern for SaaS platforms

Related Terms

Frequently Asked Questions

How do I secure webhooks?
Verify the webhook signature using the shared secret (HMAC-SHA256), use HTTPS endpoints only, validate the timestamp to prevent replay attacks, and whitelist the sender's IP addresses if available.
What if my webhook endpoint is down?
Most webhook senders retry failed deliveries with exponential backoff (e.g., 1min, 5min, 30min, 2hr). Implement your endpoint to be idempotent so retried deliveries do not cause duplicate processing.
How are webhooks different from APIs?
APIs are pull-based (you request data when you need it). Webhooks are push-based (data is sent to you when events occur). They complement each other: use webhooks for real-time notifications and APIs for on-demand data retrieval.