Webhook
A webhook is an automatic message one system sends to another the moment something happens. The receiving system does not have to keep asking. The news comes to it.
What is a webhook?
A webhook is when software sends a message to an agreed address as soon as an event happens. With an API, you ask and the other side answers. With a webhook, the other side tells you the moment something happens, which is why it is sometimes called a reverse API.
Here is an everyday case. A customer pays by card on your site. The payment provider tells your site through a webhook that the payment was approved. Your site then confirms the order and notifies the warehouse. It does not need to ask every minute whether the payment has arrived.
Why does it matter?
Webhooks move information between systems without delay and cut down on needless requests. Set up badly, messages can be lost, so incoming messages should be verified and failed ones retried. See how we build connections on our integrations page. How payment confirmations arrive by webhook is covered in payment gateway integration.
Frequently asked questions
What is the difference between a webhook and an API?
With an API, you ask and the other side answers. With a webhook, the other side tells you the moment something happens. Most integrations use both.
Are webhooks secure?
Yes, when set up properly. The signature on each incoming message is checked to confirm it came from the expected source. The endpoint should use https and the payload should be validated before it is processed.
What happens if a webhook message fails?
Most services retry failed messages at intervals. You should still log messages and make sure the same one is not processed twice, so an order is never confirmed twice.