Home/Glossary/Webhook

Webhook

A mechanism for real-time notification of events to external systems via HTTP POST requests.

A webhook is a method of data transfer between applications initiated by the source system. Unlike polling, where a client periodically checks for updates, a webhook delivers information immediately upon an event. This creates an event-driven architecture that eliminates the need for constant status checks and reduces latency.

How it works

The source system sends an HTTP POST request to a pre-configured URL (endpoint) on the receiver side. The request body typically contains a JSON payload with specific event details. The receiving server must acknowledge receipt with a 200 OK status code. If the receiver is offline, the sender often employs a retry policy with exponential backoff to ensure reliable data delivery.

Webhooks are used for automating CI/CD pipelines, processing payment notifications in gateways, and syncing data between CRM platforms and messaging apps. For instance, GitHub triggers a webhook on every git push to initiate automated testing or deployment processes without manual intervention.

Implementing webhooks significantly reduces network overhead and CPU usage. Data shows that with a 1-minute polling interval, up to 98% of traditional API requests can be redundant, whereas webhooks fire only when there is an actual payload to deliver, optimizing resource consumption.