News

Webhooks: How They Work, Testing and Security

· DigifyNow

Auf Deutsch lesen

A webhook is a URL you register with a service. When an event happens there, such as an invoice being paid, the service immediately sends an HTTP POST with the data as JSON to that URL. Your receiver verifies the signature, replies quickly with a 2xx status code and only then processes the data. If that reply doesn't arrive, the sender delivers the message again, so the receiver has to detect duplicates.

What is a webhook?

A webhook is an automated HTTP message. One system sends it to a URL registered by another system as soon as a specific event happens. The receiving side doesn't have to keep asking whether anything is new. It gets notified instead, usually through a POST request that carries the event data as JSON.

To make that work, the receiving system provides an address, known as the webhook endpoint. You enter that address in the sending service and choose which events it should report. From then on your system no longer has to check in. The service reaches out on its own the moment something happens. Developers call this push instead of pull.

A concrete example: a customer pays online through Stripe. Stripe creates an internal "payment succeeded" event and sends an HTTP request using the POST method to the registered URL. The body of the request, called the payload, contains a JSON object with the event type, the amount, the customer ID and a unique event ID. Your receiver reads it, records the incoming payment in the CRM and triggers the invoice email. Nobody has to open the payments dashboard for any of this. One thing matters here: a webhook only carries the message. Everything after that, checking, storing and passing the data on, is the receiver's job.

Illustration for the question "What is a webhook?"
AI-generated image

What do businesses use webhooks for?

Webhooks fit wherever one system needs to tell another about a single, clearly defined event. Typical cases in small and mid-sized companies:

  • Payment received: the payment provider reports the payment, and accounting or the CRM marks the deal as "paid".
  • Form submitted: the website reports a new inquiry, and the CRM instantly turns it into a contact with a follow-up reminder.
  • Code changed: GitHub reports a push, and a build or deploy process starts.
  • Message received: a messaging or ticketing system reports a new message to an automation workflow.
  • Status alert for the team: an internal system automatically posts errors to a chat channel.

If you only get a handful of events a day that someone handles manually anyway, building this often isn't worth it. The same goes when the sending service doesn't offer webhooks at all. Then your only option is polling the API at regular intervals. Which workflows are generally good candidates for automation is covered in our article on automating business processes in SMBs.

How does a webhook work?

Technically, every webhook delivery follows the same steps, whether the sender is a payment provider, an online store or a code repository:

  1. Register: you give the sender your endpoint URL (always with https) and pick the event types. In most cases you receive a shared secret at this point, the signing secret.
  2. Event occurs: something happens on the sender's side, such as a payment, an order or a push.
  3. Delivery: the sender sends an HTTP POST to your URL. The header carries a signature, the body carries the event as JSON.
  4. Verify: your endpoint recomputes the signature itself using the secret and rejects the request if the values don't match.
  5. Acknowledge: the endpoint responds with a success status code in the 2xx range. This happens before any lengthy processing starts.
  6. Process: only then does the actual work run, ideally through a queue. That way slow downstream systems can't delay the response.
  7. Retry: if no success response comes back, the delivery counts as failed. Many providers then try again on a fixed schedule.

Here is what such a message looks like in a real project: a contact form on a website that reports to a CRM. The payload typically has four parts: the event type (for example "event": "form.submitted"), a unique event ID (for example "id": "evt_abc"), a timestamp in ISO format and, under "data", the form fields such as name, email and request. The receiver first checks whether the ID evt_abc has already been processed. If it's new, it creates the contact and sets a follow-up reminder for sales. If the same message arrives a second time, nothing happens. This check on the event ID prevents duplicate contacts when the sender resends after a slow response.

Illustration for the question "How does a webhook work?"
AI-generated image

Webhook vs. API: who asks, and who calls?

A webhook doesn't replace an API, it's the counterpart to one. You call an API actively: you ask, and the system answers. With a webhook it's the other way around. The other system calls you as soon as something happens. In practice, the two work together. Often the webhook message contains only the event ID, and your system then fetches the full data through the API. How endpoints, methods and tokens fit together in an API is explained in our article What Is an API? Definition, Example, Practice.

Polling, webhooks and WebSockets compared by trigger, timing and limits
MethodWho starts the communication?When does new data arrive?Where it hits its limits
Polling via APIYour system checks at fixed intervalsOnly at the next checkMany requests return no new data, and changes between two checks arrive late
WebhookThe sender reports every eventShortly after the eventYour endpoint must be publicly reachable. If it's down for too long, messages are lost after the final retry.
WebSocketBoth sides keep a persistent connection openContinuously, in both directionsThe connection has to be kept alive at all times. For individual business events between two servers, that's usually more effort than needed.

Are webhooks secure?

A webhook URL is publicly reachable, so anyone who knows it can send requests to it. How secure a webhook is therefore depends on what the receiver checks, not on the mechanism itself. The major providers sign their messages. Stripe sets a Stripe-Signature header with a timestamp and an HMAC signature based on SHA-256 and describes how to verify it in its webhook documentation (as of November 2026). GitHub sends a signature in the X-Hub-Signature-256 header, as described in the GitHub documentation (as of November 2026).

  • Verify the signature: compute the value over the unmodified raw body of the request. If you parse the JSON first and serialize it again, the bytes change and verification fails.
  • Compare in constant time: use a comparison function that always takes the same amount of time. Otherwise an attacker can guess the signature step by step by measuring response times.
  • Check the timestamp: reject older messages. That way an intercepted request can't be replayed later.
  • Protect the secret: the signing secret belongs in an environment variable or a secrets vault, not in the source code.
  • HTTPS only: without encryption, the payload and headers can be read in transit.
  • Don't trust the data blindly: before releasing a shipment, double-check a message like "order paid" against the API.
Illustration for the question "Are webhooks secure?"
AI-generated image

What goes wrong with webhooks

Most webhook problems don't show up in the first test. They surface once the system is running in production. The typical failures and their causes:

  • Duplicate processing: the endpoint processed the message but responded too late, so the sender sends it again. The fix is idempotency. Store the event ID and skip any ID that has already been processed.
  • Timeouts: the endpoint first generates a PDF, writes to the ERP and only then responds. Better: acknowledge immediately and put the work in a queue.
  • Wrong order: "order canceled" arrives before "order created". There is no guarantee of ordering. The receiver has to check the timestamp or the current state via the API.
  • Silent outages: the server was unreachable overnight, and after the final retry the sender gives up. Without monitoring and regular reconciliation, the gap often goes unnoticed for weeks.
  • Changed payload: the provider adds fields or renames them. A receiver that rigidly validates against a fixed format then breaks.
  • Stale configuration: after a website migration, the registered URL points nowhere, and nobody reads the sender's error notifications.

Webhook testing: how to test a webhook

To test a webhook, you need a receiver that's reachable from the outside and an event you can trigger on purpose. This sequence has proven itself in practice:

  1. Inspect the payload: first send the message to a temporary receiving URL, like the ones services such as Webhook.site provide. That way you see the headers and JSON exactly as they arrive. Use test data only, never real customer data, because the data then sits with a third-party service.
  2. Forward locally: for development on your own machine, some providers offer forwarding tools. With the Stripe CLI and the stripe listen command plus the --forward-to option, test events land on a local port. Stripe describes this in its webhook documentation (as of November 2026).
  3. Trigger a test event: most providers have a test mode or a resend button. Use it to check the entire path through to processing.
  4. Provoke failure cases: deliberately send a wrong signature (expected: rejection) and the same event ID twice (expected: processed only once). Also have the endpoint respond once with a server error (expected: a retry).
  5. Check the logs: look in the sender's dashboard to see which status code came back and how long the response took.

In n8n, the Webhook node has a test URL and a production URL. The test URL only accepts requests while the workflow in the editor is waiting for an event. A common mistake: the test URL gets registered with the sender, and later people wonder why nothing arrives anymore. Details are in the n8n documentation (as of November 2026).

Illustration for the section "Webhook testing: how to test a webhook"
AI-generated image

Receiving webhooks: Make, n8n or your own endpoint

If you don't want to write code to handle webhooks, you can receive them with an automation tool. According to its help center, Make generates a URL that an external app, a service or another scenario can call. The help page has dedicated sections on error handling and on a rate limit for webhooks. Disclosure: DigifyNow is a Make partner and has a referral code there. n8n offers a Webhook node and, according to its documentation, can also be self-hosted. The third option is your own endpoint in your own code.

As of November 2026. Make details per help.make.com, n8n details per docs.n8n.io
OptionWhere the webhook URL is createdWho runs itWhere it hits its limits
MakeAs a webhook module in the scenario, running in the vendor's cloudMake runs the platform, you maintain the scenarioThe vendor's rate limit and billing apply. Checks such as idempotency have to be built into the scenario yourself.
n8nAs a Webhook node in the workflow, with a test and a production URLDepending on your choice, the vendor's cloud or you on your own serverIf you self-host, updates, uptime and backups are on you as well
Your own endpointAs a route in your own applicationYou or your development partnerSignature verification, queueing, retries and monitoring have to be built and maintained

How DigifyNow works with webhooks

DigifyNow, based in Unnau in Germany's Westerwald region, connects systems such as forms, payment providers and CRMs through webhooks and APIs in client projects. In AI automation, a webhook is often what kicks off a workflow: an event comes in, an AI assistant prepares it, and an employee approves the result. In CRM development, we plan the receiver in from the start, including signature verification, stored event IDs and an error log. Whether a tool is enough or you need your own endpoint comes down to three questions: How many events come in? What happens if a message gets lost? And who will run it?

When outside help pays off

Many teams set up a single webhook that posts messages to a chat channel on their own. Outside help makes sense when money or deliveries depend on the message, when several systems need to react in a fixed order, or when nobody in-house can monitor the endpoint. For a first conversation, have this ready: which systems send and receive messages, which events matter, what happens when a message gets lost and who is responsible for running it. Through our contact page you can request a free, no-obligation assessment of your project.

Frequently asked questions

What is a webhook in simple terms?

A webhook is an automatic notification sent over HTTP. You register a URL with a service, and when a defined event happens, such as a new order, the service immediately sends a POST request with JSON data to that URL. Unlike an API request, your system doesn't ask; it gets called. The receiver checks the message, acknowledges it with a 2xx code and processes it.

What is a webhook payload?

The payload is the content of the HTTP request a webhook sends. It's usually a JSON object with the event type, a timestamp, a unique event ID and the affected data or just its ID. The sender defines the structure. It can change with new versions, so a receiver should ignore unknown fields rather than fail.

Do I need my own server for webhooks?

Not necessarily. The receiver just has to be reachable at a public HTTPS address. That can be an automation tool such as Make or n8n in the cloud, a serverless function or your own application. DigifyNow is a Make partner. Your own server is worth it if you want full control over processing, logs and data storage.

What status code should a webhook receiver return?

A success code in the 2xx range tells the sender the delivery worked. Many providers treat client or server error codes, and missing responses, as a failed delivery and resend later. So respond after verifying the signature but before any time-consuming processing, and put the actual work in a queue.

What does idempotency mean for webhooks?

Idempotent means that processing the same message several times produces the same result as processing it once. Because senders resend after timeouts, an event sometimes arrives twice. To handle this, the receiver stores the event ID and skips IDs it already knows. Otherwise you could end up with, say, two invoices for one payment.

Request a free assessment of your project