OpsLabs Book a call

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.

The problem it solves

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.

One order arrives at 09:03two ways to find out idle
Six of the seven checks on the left found nothing. That is the cost of asking.

Webhooks are cheaper and faster. They have one weakness that decides when not to use them, and it is below.

The catch

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.

 PollingWebhook
SpeedAs fast as your interval Immediate
Wasted workMost checks return nothing None
If you are downCatch up on the next run Messages may be lost permanently
Recovering a gapMove the cursor back and re-read Often impossible without the sender's help
Use it whenCompleteness matters more than seconds Reacting quickly matters and loss is survivable
What we built with it

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.

12sync jobs, zero webhooks
0events lost to downtime, because none can be
Re-runnableevery job, safely, at any time
See the analytics build
Related terms

Words that turn up next to this one.

Common questions

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.

Working together

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.

Book a 30-minute call

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.