ENES

Webhook

A way for one service to call your app the moment something happens.

Instead of an app asking a payment service again and again whether anything happened, the service calls the app's URL once when a payment arrives

A webhook is a message one system sends to another automatically when an event happens. You give a service a URL of yours, and when the event occurs (a payment succeeds, someone pushes code to GitHub, a form is submitted) the service makes an HTTP POST request to that URL with the details, usually as JSON.

It is an API call in the opposite direction. With a normal API your app asks: "any new payments?" To find out quickly it would have to ask every few seconds, which is called polling and wastes effort when the answer is almost always "no". With a webhook your app says once: "call me here when it happens", and then just listens.

Since anyone on the internet could send a request to that URL, well-designed webhooks are signed: the sender attaches a code computed with a shared secret, and your app checks it before trusting the message. Senders also retry when your app does not answer, so the same event may arrive twice, and good receivers are prepared to ignore duplicates. Tools like Zapier are built largely on webhooks, connecting one service's events to another's actions.

Keep in mind

Go deeper

Related terms

More in Software