Webhook — What It Is and How It Works
Webhook
Updated October 21, 2025
Dhey Avelino
Definition
A webhook is an automated way for one application to send real-time event data to another by making an HTTP request to a predefined URL when something happens.
Overview
A Webhook is a lightweight mechanism that allows applications to notify each other about events as they happen. Instead of one system repeatedly asking another if anything has changed (a technique called polling), the system that detects the event sends a short HTTP request to a URL supplied by the receiving system. This makes webhooks efficient, near real-time, and easy to integrate for many common workflows.
At its core, a webhook consists of three parts: the event producer (the service that notices an event), the event payload (a small package of data describing the event), and the webhook endpoint (a URL on the consumer's side that receives the payload). Typical events include 'new customer created,' 'invoice paid,' or 'repository push.' When the producer sees the event, it makes an HTTP POST to the endpoint with a payload, usually formatted as JSON.
Some simple, everyday examples help make the concept concrete:
- When a customer completes a payment in a payments service, that service sends a webhook to your order system so you can mark the order as paid.
- A code hosting platform sends a webhook to your continuous integration server when a developer pushes code, triggering a build and test run.
- An e-commerce platform sends inventory change events to a logistics provider so stock counts stay synchronized across systems.
Webhooks differ from polling in several helpful ways. Polling requires periodic requests from the consumer to the producer to check for updates, which increases latency and consumes more resources for both systems. Webhooks are push-based, so updates arrive as soon as they occur, generally reducing delay and unnecessary network traffic.
From a technical viewpoint, most webhooks use standard HTTP verbs and formats. The producer typically sends an HTTP POST with a JSON body and headers describing the event type, delivery ID, and sometimes a signature to prove authenticity. The consumer's endpoint should respond quickly with an HTTP 2xx status code to acknowledge receipt. If the producer does not receive a successful response, it will often retry delivery according to a backoff strategy.
There are important practical considerations with webhooks:
- Reliability and retries — Producers usually retry failed deliveries; consumers must handle potential duplicate events by making processing idempotent.
- Security — Use HTTPS to protect data in transit. Producers often sign payloads with a shared secret so consumers can verify authenticity.
- Scalability — High-volume events can flood endpoints. Rate limiting, queuing, and asynchronous processing on the consumer side help manage spikes.
- Versioning — As producers evolve payload formats, using versioned event types or fields prevents breaking consumers.
Real-world services that implement webhooks include code hosting platforms, payment gateways, e-commerce platforms, and form services. For example, a code platform may post a webhook when there is a new push to a branch; a payment processor posts an event when a charge succeeds or fails. These integrations enable automated workflows like deployment, order processing, and notifications without human intervention.
For beginners exploring webhooks, it helps to try simple experiments: register a webhook URL with a sandbox service, use a tunneling tool such as ngrok to expose a local endpoint to the internet, and log the incoming payloads. Most providers offer dashboard tools to replay and inspect deliveries, which makes debugging easier.
In short, a Webhook is a powerful, event-driven tool for connecting applications in near real-time. It reduces latency, conserves resources compared to polling, and enables many automated workflows — provided you plan for security, idempotency, and scalability when designing your endpoint and processing logic.
Tags
Related Terms
No related terms available
