Webhook
A webhook is an event-driven HTTP callback that pushes data to a registered URL, replacing polling for near real-time integration.
A webhook is a mechanism for one application to notify another about events in near real time. The receiver registers a URL with the sender, and the sender makes an HTTP POST to that URL whenever a relevant event happens.
How It Works
The consumer exposes a public HTTPS endpoint and configures it with the provider, often choosing which event types to receive. When an event occurs, the provider serializes a payload, usually JSON, and POSTs it to the endpoint. The consumer responds quickly with a 2xx status to acknowledge receipt, then processes the work asynchronously.
Production webhooks need several safeguards. Senders sign payloads, commonly with an HMAC signature in a header, so receivers can verify authenticity. Because networks fail, senders retry on non-2xx responses, which means the same event may arrive more than once. Receivers therefore make handlers idempotent, often by deduplicating on an event ID.
Why It Matters
Webhooks replace inefficient polling, where a client repeatedly asks "has anything changed?" Pushing events reduces latency and load and is the backbone of integrations across payment, messaging, version control, and CI systems.
The trade-offs involve delivery guarantees and security. Receivers must be available, validate signatures, guard against replay, and handle retries gracefully. At high volume, teams put a queue behind the endpoint so the HTTP handler can return immediately.
Related Terms
Webhooks build on REST conventions and JSON payloads, depend on idempotency for safe retries, and are an alternative to streaming approaches like server-sent events.