Skip to the content.

1. What is a Webhook?

A webhook is a way for one service to notify another service automatically when an event happens.

Unlike APIs where you ask for data (pull), webhooks are push-based—the sender pushes the data to you when an event occurs.


2. How Webhooks Work

  1. You register a URL (your webhook endpoint) with a service.
  2. The service detects an event (e.g., a new order, a payment success).
  3. It sends an HTTP request (usually POST) to your URL with event data.
  4. Your service receives the data and processes it immediately.

3. Real-Life Analogy


4. Example Use Cases

Event Source Webhook Example
GitHub Notify your CI/CD server when new code is pushed
Stripe/PayPal Notify your server when a payment is completed
Twilio Notify your server when an SMS is received
Slack Receive messages/events in your app automatically

5. Key Points