What Is a Webhook?

by•

1. What is a webhook?

A webhook is an HTTP callback. When an event happens in system A, system A proactively sends an HTTP request (usually a POST) to a URL you provided, carrying data about that event.

In short: instead of you asking over and over, the other system tells you when something happens.

Real-life analogy: You order something online.
Polling = walking to the front door every 10 minutes to check if the courier has arrived.
Webhook = leaving your phone number so the courier calls you when they're outside.

Webhooks are often called a "reverse API" or "push API", because the direction is flipped: instead of the client calling the server, the server calls the client.

2. How do webhooks work?

A webhook flow has four steps:

  1. Register: You give the provider a public URL (an endpoint) to receive data.

  2. Event happens: Someone pushes code, a payment succeeds, money lands in an account...

  3. Deliver: The provider sends a POST request with a payload (usually JSON) to your URL.

  4. Acknowledge: Your server returns a 2xx to confirm receipt. If it doesn't, most providers will retry later.

You use webhooks every day, maybe without noticing:

  • GitHub fires webhooks to trigger CI/CD on pushes and pull requests.

  • Stripe fires webhooks when a payment succeeds or is refunded.

  • Slack / Discord let you post messages into channels via incoming webhooks.

  • Bank notification services fire webhooks when an account balance changes — more on this at the end.

8 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.