What is a webhook?
Sometimes called a callback or an HTTP push
A webhook is a message one system sends to another the moment something happens, instead of the second system repeatedly asking whether anything has changed. You give the sender a URL, and they post to it when the event occurs.
The everyday version: stop asking, and be told. Instead of checking every minute whether an order came in, the other system knocks on your door the second one does.
Asking, over and over, for nothing.
Two systems need to stay in step. An order is placed in one, and the other has to know. The obvious way is to keep asking: check every minute, and act when the answer changes.
That works, and it means almost every check comes back empty. A webhook inverts it. Instead of you asking, the other system tells you the moment it happens.
Pollingyou keep asking
Check every minute, whether or not anything happened.
Webhookthey tell you
Nothing at all until something actually happens.
Webhooks are cheaper and faster. They have one weakness that decides when not to use them, and it is below.
A missed webhook is gone forever.
If your server is down for four minutes, the messages sent during those four minutes are not waiting for you. Most senders retry a few times and then give up, and you have no way of knowing what you never received.
A missed poll costs nothing. You simply ask again and get everything since last time. That difference is why serious systems often deliberately choose the slower option.
| Polling | Webhook | |
|---|---|---|
| Speed | As fast as your interval | Immediate |
| Wasted work | Most checks return nothing | None |
| If you are down | Catch up on the next run | Messages may be lost permanently |
| Recovering a gap | Move the cursor back and re-read | Often impossible without the sender's help |
| Use it when | Completeness matters more than seconds | Reacting quickly matters and loss is survivable |
We chose polling on purpose.
Twelve sync jobs and not one webhook
BrokerStaffer's campaign analytics had an earlier design built on webhooks, with an event table headed for millions of rows a year to reconstruct data the sending platform's API already returned. That came out.
Every ingestion path is now a cursor over a call that can be repeated safely. Watermarks only advance on success, so a failed run re-covers its window instead of stepping over it. Slower in theory. Correct in practice, which mattered more.
Words that turn up next to this one.
Still unclear?
What is a webhook?
A webhook is a message one system sends to another the moment something happens, instead of the second system repeatedly asking whether anything has changed. You give the sender a URL, and they post to it when the event occurs.
What is the difference between a webhook and an API?
An API is something you call when you want data. A webhook is something that calls you when there is data. They are usually used together: the webhook tells you an order was placed, and you call the API to get the full details.
Webhook or polling, which should we use?
Use webhooks when reacting quickly matters and the occasional lost message is survivable. Use polling when completeness matters more than seconds, because a missed poll costs nothing while a missed webhook can be gone permanently.
What happens if our server is down when a webhook fires?
Most senders retry a handful of times and then stop. Anything sent while you were unavailable may be lost with no record on your side that it ever existed, which is the single biggest argument against relying on webhooks alone for anything financial or contractual.
Can webhooks be sent twice?
Yes, and they regularly are, because senders retry when they are unsure you received the first one. Any webhook handler has to be safe to run twice on the same message, otherwise you get duplicate orders, duplicate charges or duplicate emails.
Wondering what this would look like on your stack?
Thirty minutes. We will tell you whether it is worth building and what it would take. No deck.
OpsLabs builds custom operational systems for growing companies. This page is part of a plain-English glossary of the terms that appear in our proposals and on this site.