Core concepts · Automation

What is a webhook?

4 min read

In one sentence

A webhook is an automatic notice: one application sends a message to a specific web address at the moment something happens (a payment, a form, an order), so another application can react instantly.

01

Why it matters in a business

A webhook matters because it makes two systems talk the moment something happens, without waiting for someone to check. It is the piece that lets, for example, a confirmed payment alert your spreadsheet instantly.

02

How it works

It is the opposite of asking every so often "has anything happened?". Instead, whoever has the information notifies you when it occurs. It is faster and uses fewer resources.

Since anyone could call that address, a well-built webhook checks a signature or a secret to make sure the notice comes from who it claims to.

03

Understanding it in depth

A webhook is an automatic notice one program sends to another at the moment something happens: a customer fills in a form, an order is paid, an appointment is cancelled. Instead of your system asking every minute whether there is news, the other program calls a web address you gave it as soon as there is something to report.

Technically it is a web request carrying the data of the event, usually in JSON format. The receiver answers with a code saying it received it properly. If it does not answer or returns an error, many services retry after a while, so the receiver should be able to get the same notice twice without duplicating the work.

Because the webhook address is public, it must be protected: check that the notice really comes from the expected service (with a signature or secret key), do not trust the data without validating it and do not post the address where anyone can see it. An unprotected webhook lets a stranger trigger your processes.

04

The pieces, one by one

  • The sender

    The service where the event happens and that sends the notice, for example the payment gateway.

  • The address (URL)

    The place the notice is sent to; the receiver creates it and it should be kept private.

  • The payload

    The information about the event, which the receiver reads and validates before acting.

  • The response

    The code with which the receiver confirms it received the notice.

05

An example in a business

When a customer pays a subscription, the payment gateway sends a webhook to the business website; the site activates the customer’s credits on the spot, with nobody having to look.

06

When yes and when no

It makes sense when…

  • You want to react instantly to an event without constantly checking.
  • The source service offers webhooks and the notice carries the data you need.
  • You can validate the signature and handle repeated notices.

Better not when…

  • The service does not offer webhooks: you will have to check every so often.
  • You have nowhere to receive the notice securely.
  • You need an absolute delivery guarantee with no later checking mechanism.

07

Common mistakes

  • Not checking that the notice comes from who it says it does.
  • Not planning for the same notice arriving twice.
  • Publishing the webhook address where anyone can see it.

08

How to start

  1. Identify the event you want to detect (a payment, a form).
  2. Create the address that will receive the notice in your tool.
  3. Paste it into the service that generates the event.
  4. Test with a real event and check what data arrives.

09

Frequently asked questions

Is a webhook the same as an API?

No. An API is queried when you want; a webhook tells you when something happens.

Is it safe?

It is if you verify the signature or a secret and do not expose the address publicly.

What if my system is down?

Many services retry; even so it is wise to store notices and be able to replay them.

What is the difference between a webhook and an API?

With an API you ask when you want; with a webhook the other system tells you when something happens. Many integrations use both: the webhook notifies and the API is used to request the detail.

What if my system is down when the notice arrives?

Many services retry for a while, but not all of them. That is why it helps to have a way of periodically checking that no important notice was lost.

Is a webhook secure?

It is if protected: private address, verified signature and validation of what is received. Without that, anyone who knows the address could send fake data.

10

Quick glossary

JSON
A simple text format for exchanging data between programs.
Signature
A code that lets you check the notice comes from the expected service.
Idempotency
The property of being able to receive the same notice several times without duplicating the result.

11

Go deeper

To see how it is applied in practice, read the guide Automate processes with n8n: a practical guide for small businesses.

Related concepts

All concepts

Let’s talk

Want to see how it applies in your business?

Tell us your case. We reply within 24 hours with a real proposal. No strings attached.