What is a webhook and why is it everywhere

Published on 2026-09-12 by frfrand

Instead of asking every five minutes, the other service notifies you. How a webhook works, why to verify the signature, and three details that break integrations.

What is a webhook and why is it everywhere

Short answer: a webhook is an HTTP request that another service sends you when something happens, instead of you asking every so often. To use it well you must verify the signature on the raw body, respond quickly and process later, tolerate repeated events and not assume they arrive in order.

Without webhooks, the only way to find out about something happening in another service is to ask: every minute, every five minutes, every hour. That is called polling and it has two obvious problems: you spend calls to listen "nothing happened", and you find out late.

A webhook inverts the direction. You register an address of yours, and when something happens, the other service sends you an HTTP request.

It is the same as leaving your phone instead of calling every half hour to ask if there is news.

How it looks in concrete terms

You register a URL. When the event occurs, something like this arrives:

POST /webhooks/pagos HTTP/1.1 X-Signature: sha256=8f3a... Content-Type: application/json

{"evento":"pago.aprobado","id":"pay_123","monto":4500}

Your server receives that, verifies that it is legitimate, does what is appropriate and responds 200.

Verifying the signature is not optional

That address is public: anyone who knows it can send data to it. Without verification, anyone could tell your system "this payment was approved".

That is why serious services sign each shipment with a shared secret. Your job is to recalculate that signature on the received body and compare it.

Three details that are often overlooked:

  • You must calculate the signature over the raw body, not over JSON that has already been parsed and re-serialized. A single space difference and the signature won't match.
  • The comparison must be constant-time, not a simple equality check, to avoid leaking information through response time.
  • Many services include a timestamp: it's a good idea to reject old submissions, so no one can resend a captured one.

The three details that break integrations

1. Respond quickly. The sender waits a few seconds and, if you don't respond, considers it failed and retries. If your handler takes thirty seconds to process, you'll receive the same event multiple times.

The correct approach: validate, save the event to a queue, respond with 200, and process later. The webhook confirms receipt, not the work.

2. Events repeat. Due to retries, network failures, or manual resends. Your handler must be idempotent: receiving "payment approved" twice cannot charge twice.

The usual approach is to save the event identifier and discard duplicates.

3. Order is not guaranteed. You might receive "order updated" before "order created". If your logic assumes sequence, it will fail in strange and intermittent ways. When order matters, rely on timestamps or current state, not on arrival order.

How to test

The classic problem: the service needs a public address and you are developing on your machine.

Two paths: a tunnel that temporarily publishes your local port, or saving the events that arrive at a test environment and reproducing them locally. The second is more boring and much more reliable for debugging.

And the tip that saves the most time: almost all services store the delivery history with the body sent, the response code, and the response. Before touching code, check that history. Half the time the problem is right there in plain sight: a 404 due to a mistyped route, or a 500 that says exactly what failed.

Where they appear

Almost everywhere: GitHub when you push, payment platforms when a charge is approved, WhatsApp when a message arrives, forms when someone submits them.

In ArduMaker it is the mechanism that triggers deployments: GitHub notifies, the server validates the signature (HMAC-SHA256 with a secret specific to each repository) and executes the build. It also discards duplicate deliveries by their identifier, which are exactly two of the defenses in this article.

A webhook in production is a public entry point

When a payment platform sends a notification, the API that receives the webhook must verify that the request comes from the legitimate sender, respond quickly, and process retries without duplicating operations. A hard-to-guess URL does not replace authentication or signature verification.

You can host the receiver on an ArduMaker VPS with HTTPS and log events to investigate failed deliveries. If processing takes time, accept the event securely and pass it to a job queue, respecting the integration requirements.

Related: Job queues · HTTP errors.

Frequently asked questions

What is the difference between a webhook and an API? With an API you ask whenever you want; with a webhook the other service notifies you when something happens, calling one of your addresses.

How do I verify that a webhook is legitimate? By recalculating the signature (usually an HMAC with the shared secret) over the raw body and comparing it in constant time. If the service sends a timestamp, reject old deliveries.

What do I do if the same event arrives twice? Save the identifier of each processed event and discard duplicates. The handler must be idempotent.

  • webhooks
  • integraciones
  • HTTP
  • automatización
  • API

Keep reading

All articles · VPS plans