Webhooks Explained: How Apps Talk to Each Other Instantly

Webhooks explained in plain terms means a way for one app to send another app an automatic message the moment something happens, instead of the second app having to keep asking. The central question is how webhooks differ from an ordinary API call, and the short answer is direction: with an API you ask for information, while with a webhook the information comes to you, pushed the instant an event occurs.

Think of the difference between ringing a shop every five minutes to ask whether your parcel has arrived, and the shop phoning you the moment it is on the shelf. The first wastes everyone’s time, the second gives you the news exactly when it matters. Webhooks are the phone call.

They sit behind countless everyday moments: the message that tells you a payment went through, the notification when someone comments on your post, the alert that a parcel has shipped. In each case, one system told another system something had happened, without anyone pressing refresh.

Key takeaways

  • A webhook is an automatic message one app sends to another the moment an event happens.
  • It is the opposite of polling an API, where the receiver must keep asking for updates.
  • Webhooks usually arrive as a simple HTTP request carrying a small package of event data.
  • They power payment alerts, shipping updates, and notifications across the apps people use daily.
  • Receivers must check that messages are genuine and handle duplicates and failures.

What a webhook is

A webhook is a mechanism for sending real-time data from one application to another when a specific event takes place. The sending app is configured with a URL, called the webhook endpoint, belonging to the receiving app. When the event happens, the sender posts a message to that URL, and the receiver acts on it.

The message usually arrives as an HTTP POST request carrying a payload, a small bundle of data describing the event, often in JSON format. A payment webhook might carry the order number, the amount, and the payment status. A code-hosting webhook might carry the repository name and the details of the change just made.

Webhooks are sometimes called reverse APIs, because the flow is reversed. With a normal API, the app that wants data asks for it. With a webhook, the app that has the data sends it, without being asked. The receiver simply listens at its endpoint and reacts when something arrives.

Our guide to API gateways explains how services organise and protect the API calls that webhooks often sit alongside. The two approaches work together: APIs for asking, webhooks for telling.

How webhooks work

Setting up a webhook has three parts. First, the receiving app exposes an endpoint, a URL ready to accept incoming messages. Second, someone registers that URL with the sending app, choosing which events should trigger it, such as a completed payment or a new order. Third, the sending app starts delivering messages whenever those events happen.

When an event fires, the sender builds the payload and sends it to the endpoint, usually within seconds. The receiver reads the payload, checks it, and does whatever the event requires: updating an order, sending a customer a message, or starting the next step in a workflow. It then answers with a success response so the sender knows the message arrived.

Good senders plan for failure. If the receiver is down or answers with an error, the sender usually retries, sometimes several times over hours, before giving up. This retry behaviour is important, because a missed webhook can mean a missed payment or an order that never ships.

Security matters because an endpoint is a public URL that anyone could try to call. Senders therefore sign their messages, adding a signature the receiver can verify against a shared secret. A message without a valid signature should be ignored, since it may be fake.

A photograph of a dark office desk at night with two laptop screens glowing lime green and a small paper plane model beside them
A webhook carries a small package of event data from one app to another the moment something happens.

Comparing webhooks with polling

Aspect Webhooks Polling an API
Who starts it The sender, when an event happens The receiver, on a schedule
Speed of updates Near instant Only as fast as the check interval
Server load Low, messages only on events High, many checks return nothing new
Missed events Possible if the receiver is down Unlikely, the next check catches up
Best for Alerts and real-time reactions Occasional checks and simple integrations

Where webhooks are used

Payments are the classic example. When a customer pays, the payment service sends a webhook to the shop, which marks the order as paid and starts preparing it for shipping. Without that instant message, the shop would have to keep asking the payment service whether the money had arrived.

Team tools rely on them heavily. A message in a chat app when code is deployed, a ticket is updated, or a form is submitted is usually a webhook at work. They turn events in one system into visible updates in another, keeping teams informed without anyone checking dashboards.

Online shops, delivery services, and booking systems use webhooks to keep their moving parts in step. An order placed on one platform triggers stock updates, shipping labels, and customer emails on others, all chained together by event messages rather than by people copying data between systems.

Developers also use them to automate their own workflows. A push to a code repository can trigger tests, a deployment, or a notification, and each step is started by a webhook from the previous one. Our guide to AI operations explains how teams keep these automated chains running reliably once they are in production.

What webhooks cannot do

Webhooks cannot guarantee delivery on their own. A message can be lost if the receiver is offline, and retries help but do not remove the risk entirely. For anything where a missed event would be serious, the receiver should also reconcile against the sender’s records from time to time, rather than trusting webhooks alone.

They also cannot answer questions. A webhook tells you that something happened, but if you need the full details, you usually have to ask the sender’s API for them. The payload is kept small by design, and fetching the rest is the normal pattern.

Duplicates are a real annoyance. A sender may deliver the same event twice, especially after a retry, so the receiver must recognise and ignore repeats. The usual fix is to give every event a unique identifier and to record which ones have already been handled.

Finally, webhooks need a reachable endpoint, which can be awkward in development or behind strict firewalls. Testing them locally often needs a tunnel or a forwarding tool, and production endpoints must be kept stable, since changing the URL means re-registering it everywhere.

Webhook checklist

  • Register webhooks only for the events you actually need.
  • Verify the signature on every incoming message before acting on it.
  • Record each event identifier so duplicate deliveries are ignored.
  • Answer quickly with a success response and do slow work afterwards.
  • Log incoming webhooks so failures can be traced and replayed.
  • Plan for retries and for events that never arrive.
  • Keep the endpoint URL stable and protect it like any public address.
  • Use a secret key for signing and rotate it if it is ever exposed.
  • Test with the sender’s test events before going live.

Frequently asked questions

What is a webhook?

A webhook is an automatic message one application sends to another when a specific event happens. The sending app posts a small package of data to a URL owned by the receiving app, which then reacts to the event, such as updating an order or sending a notification.

How is a webhook different from an API?

With an API, the app that wants information asks for it. With a webhook, the app that has the information sends it without being asked, the moment an event occurs. Webhooks are for instant notifications; APIs are for asking questions and fetching data.

What is a webhook payload?

The payload is the bundle of data sent with the webhook, usually in JSON format. It describes the event that happened, such as an order number and a payment status, so the receiver knows what to do without asking for more information.

Are webhooks secure?

They can be, if handled properly. Senders sign their messages so receivers can check they are genuine, and endpoints should use encrypted connections. An endpoint that acts on any message without checking its signature is open to abuse.

What happens if a webhook is missed?

Most senders retry failed deliveries several times. If all retries fail, the event is lost unless the receiver reconciles with the sender’s records. For important events, a regular check against the sender’s API is a sensible backup.

Can I test a webhook locally?

Yes, though it takes a little setup, since the sender needs to reach your computer over the internet. Developers often use a tunnelling tool that gives a local server a public address, or they use the sender’s test mode to send sample events.

The bottom line

Webhooks explained in one line is this: one app tells another app the instant something happens, instead of the other app having to keep asking.

They are the quiet plumbing behind payment alerts, shipping updates, and team notifications. Verify every message, handle duplicates, and keep a backup check for the events that matter most, and they will save far more effort than they cost.

This article is general information about how webhooks work, not advice about how to build a particular integration.

Latest articles

Scroll to Top