A webhook is an automatic message that one system sends to the address of another system the moment something happens – for example when a feed fails to download or a new order arrives. The second system does not have to keep asking whether there is anything new; the information arrives on its own.
What is a webhook
Imagine you are waiting for a parcel. You can phone the courier every hour to ask if it is on the way – or the courier can text you when they are outside your house. A webhook is that text message, only between two computer systems.
How it works:
- In the source system you enter the webhook address – the URL of your system that receives messages.
- When an event occurs (an error, a price change, a new order), the source system sends a POST request with data to that address, usually in JSON format.
- Your system receives the message and does something – creates a task, sends an email, starts a recalculation.
The difference from an API: with an API you ask another system ("what are the prices?"), while a webhook lets you know by itself when something changes. They are often used together – a webhook announces the change and you fetch the details through the API.
A shortened example of a message about a source error:
{
"event": "alert",
"alert": {
"kind": "source_error",
"severity": "error",
"message": "The source could not be downloaded or read: Server returned HTTP 404"
}
}What it is used for
- Alerts – a source error, an unpublished output or a price change straight into your own monitoring.
- Chat and team tools – Slack, for example, receives messages through a so-called Incoming Webhook.
- Orders and payments – a payment gateway or marketplace tells the shop about a new payment or order.
- Connecting to an ERP – an internal system learns about a change and downloads the new data itself.
What to watch out for
- Verify the sender. Anyone can call a webhook address; that is why messages are signed with a secret key and the signature must be verified.
- https only. Data should travel encrypted.
- A quick response. The receiving system should acknowledge the message immediately and do heavier work later, otherwise the sender reports an error.
- Duplicate messages. After an outage the same message may arrive again; process it so that this does no harm.
- A secret key does not belong in code in a public place or in an email.
How Sortyra helps
In Settings on the Alerts tab you add a channel of the Webhook type with a URL (https). When an event occurs, Sortyra sends a POST with JSON and a signature in the X-Sortyra-Signature header; the signing key is shown only once, when you create it. With the Send test button you check that the message arrived.
Related terms
- API
- JSON
- URL
- MCP – Model Context Protocol
- Data export
- More detail: Alerts by email, Slack, Telegram, webhook, REST API
Frequently asked questions
What is the difference between a webhook and an API?
With an API you request data when you need it. A webhook sends it to you by itself when an event occurs.
Do I need a programmer for a webhook?
To receive and process a message, yes – somebody has to prepare an address that accepts the messages. Ready-made tools such as Slack, however, accept a webhook without programming.
How do I verify that Sortyra really sent the webhook?
From the timestamp and the body of the message, calculate an HMAC-SHA256 with the signing key and compare it with the X-Sortyra-Signature header.