How it works

Instead of the client repeatedly asking if something changed (polling), the server sends an HTTP POST request to a configured URL when the event occurs. The receiver processes the payload and responds with 2xx to confirm receipt. This reverses the flow: whoever has the information sends it, saving resources.

Practical example

When a payment is approved, the gateway sends a POST to https://seusite.com/webhooks/pagamento with the transaction data. Your system updates the order without needing to poll the API periodically, reducing latency and load.

What it's for

It automates real-time integrations with little code. It's the foundation for notifications between services, AI pipelines and automations, such as triggering an agent when a new issue is created on GitHub.

Best practices

Validate the request origin, use HTTPS, respond quickly and process asynchronously if needed. This avoids event loss and silent failures in production.