Webhooks Explained: How One App Tells Another Something Happened
What a webhook is, how it differs from an API call that asks for data, and what makers' documentation says about delivery and failures.
A webhook is a message one app sends to another the moment something happens. One connector maker defines webhooks as "automated notifications sent between apps".1
Think of a doorbell. A webhook rings when a visitor arrives. The alternative is walking to the door every few minutes to look.
Webhook or API call
An API call is a request. Your app asks another app for data, and the other app answers. If you want fresh data, you have to keep asking.
A webhook flips the direction. You tell the sending app once where to send news and which events you care about. After that it pushes each event to you. GitHub's documentation says webhooks are for receiving data as it happens, as opposed to polling an API.2 Polling means calling an API intermittently to see if data is available.
One connector maker's help page describes it plainly: "Zapier periodically asks your app for data."1
| API call (polling) | Webhook | |
|---|---|---|
| Who starts it | The receiving app | The sending app |
| When data moves | Each time the receiver asks | When the event happens |
| Setup | Receiver needs access to the other app's API | You register an address to receive messages |
What a webhook contains
Each message carries data about one event. One payment company's documentation says it sends webhook events "as a JSON payload that includes event information", which is a structured block of text.3 GitHub describes webhooks as notifications delivered to an external web server whenever certain events occur.2
You choose the destination. It's a web address, called a URL, that belongs to the receiving system. A payment company's documentation says registered endpoints must be publicly accessible HTTPS URLs.3 Another way to put that: the address has to be reachable from the internet and use a secure connection.
If you use a connector tool, it supplies that address for you. If you don't write code, you may never see one.
Why makers offer webhooks
GitHub's documentation lists the benefits it sees. Webhooks allow near real-time updates, it says, because they fire when an event happens.2
It also says they scale better than API calls. Checking many resources one by one may hit an API rate limit quickly.2
The same page gives the case for plain API calls too. If you need information only once, or only now and then, you can call the API when you need it.2
Instant versus polling in connector tools
Connector tools sort triggers into two kinds. A polling trigger asks for new data on a schedule. An instant trigger waits for the app to send a webhook. For instant triggers, the tool's help page says the app sends a webhook as soon as the data is created.1
You can't pick between them freely. The same page says each app's API defines the trigger type and that you can't change it.1 How the schedule affects timing is covered in one-way vs. two-way sync and how often data moves.
When webhooks fail
A webhook is a one-time push. If the receiver is down or rejects the message, the news may not arrive. Makers handle that differently. GitHub's documentation says it doesn't redeliver failures on its own. You can handle them manually or by writing code.4
So check your own app's documentation for what it does after a failed delivery. Whether your app keeps a delivery log, and what it shows, is something only its help pages can tell you.
Other causes of a silent link are listed on the breakage page. For the bigger picture, start at what an app integration is.
Notes and sources
- How Zap triggers work, Zapier Help Center
- About webhooks, GitHub Docs
- Receive Stripe events in your webhook endpoint, Stripe Documentation
- Handling failed webhook deliveries, GitHub Docs