Webhook
A webhook is a way of integrating two systems in which one service automatically sends an HTTP request to a previously agreed URL of another application exactly when a defined event occurs — for example an order being paid, a form submitted or a deployment finished. Instead of repeatedly asking the server whether anything has changed, the receiving application simply waits for a notification.
How a webhook works
The receiver exposes a public URL (an endpoint) and the sender is configured with it in the service's settings. When an event occurs, the sender delivers a request to that URL — usually a POST carrying a JSON payload describing what happened. The receiver verifies the request's authenticity, for instance by checking a signature, processes the data and returns a confirmation code. All communication takes place over HTTPS so the payload cannot be intercepted or tampered with.
Webhook versus API
A webhook complements a traditional API: an API responds to a client's request, while a webhook is driven by an event on the server side. It is a "don't call us, we'll call you" model that reduces unnecessary traffic and delivers an immediate reaction. Webhooks are the basis of many automations — they notify payment systems, trigger CI/CD pipelines on every code push, integrate stores with shipping systems and fire off autoresponders. When designing a webhook receiver it is worth ensuring idempotency, handling retries and verifying signatures, so that duplicated or forged events do not cause problems. Used well, webhooks turn scattered systems into a coordinated whole that reacts to events in real time.
Powiązane pojęcia
Najczęstsze pytania
How does a webhook differ from an API?
With a traditional API your application asks the server for data. A webhook reverses the direction — the server notifies your application when something happens, so you do not have to keep polling to check for changes.
