Webhook
A way for one service to call your app the moment something happens.
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
- The service calls you when an event happens; you do not have to ask.
- It is just an HTTP POST to a URL you registered.
- Check the signature, because anyone can send requests to a public URL.
- Events can arrive twice or late, so handle duplicates.