# Webhook: what it is, how it works and how to test it

Source: https://checkcraft.ru/en/guides/webhook-testing.html · updated 2026-12-02

What a webhook is in plain words, how it differs from a regular API and long polling, how to receive and test a webhook: a test URL, a local server…

Practical workflow

Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. [Download, no sign-up →](https://checkcraft.ru/en/download-checkcraft.html#free-download)

A webhook is when a service itself sends an HTTP request to your address as soon as an event happens: a payment passed, an order was created, a message arrived. Instead of polling the API you get notified. Below is how it works, how to test receiving it and what usually breaks.

Checkcraft · 24 November 2026

Get help with your first test →

## How a webhook works

You register an address, usually HTTPS, in the service. On an event the service sends a POST with a JSON body to it and waits for a 2xx. With no answer or an error most services retry several times with pauses. So the handler must answer fast and handle repeats calmly.

## How to test receiving

First see exactly what the service sends: temporarily point it at a request bin or a local server and trigger the event. Then replay the same request with curl against your handler and check the response, the database record and behavior when the same event is resent.

Repeating checks like this by hand? Checkcraft saves them and reruns them in one click. [Download Free →](https://checkcraft.ru/en/download-checkcraft.html#free-download)

## Signature and security

Anyone may find a webhook address, so services sign requests with a secret: a header carries the body signature. The handler must compute it and reject the request on mismatch. Without that check anyone can send a fake payment event.

## Webhook, API and long polling

|  | Webhook | API request | Long polling |
|---|---|---|---|
| Who starts | The service | You | You |
| When data arrives | Right at the event | When you ask | When it appears, while the request hangs |
| What you need | A public address | Nothing | Nothing |
| Risk | Missed events when down, repeats | Extra requests | Long connections |

## Replaying a webhook

```
# воспроизвести webhook на свой обработчик
curl -X POST http://localhost:8080/webhooks/payments \
  -H "Content-Type: application/json" \
  -H "X-Signature: sha256=..." \
  --data @payment-succeeded.json

# повторная отправка того же события: ответ 200, второй записи в базе нет
curl -X POST http://localhost:8080/webhooks/payments \
  -H "Content-Type: application/json" \
  --data @payment-succeeded.json
```

Save a real event body to a file and run the handler on it: you can test receiving without waiting for a real payment or order.

## What to check in the handler

1. It answers 2xx fast and does heavy work after responding.
2. It verifies the signature and rejects requests without one.
3. Resending the same event does not create a second record.
4. An unknown event type does not crash it.
5. A handler error is logged with the event id.

For local development, mock the service that sends events: [local API mock](https://checkcraft.ru/en/guides/local-api-mock.html).

## More on curl

Section overview and all guides: [curl command cheat sheet: flags and examples for APIs](https://checkcraft.ru/en/guides/curl-cheat-sheet.html).

- [curl GET request: parameters, response headers and status code](https://checkcraft.ru/en/guides/curl-get-request.html)
- [cURL examples: GET and POST requests with JSON on Linux, Windows and PowerShell](https://checkcraft.ru/en/guides/curl-post-json.html)
- [Headers in curl: Content-Type application/json, Accept and multiple -H](https://checkcraft.ru/en/guides/curl-headers-content-type.html)
- [curl with authorization: Bearer token, Basic, API key and headers](https://checkcraft.ru/en/guides/curl-authorization-header.html)
- [curl errors: codes 6, 7, 22, 28, 35, 60 and how to fix them](https://checkcraft.ru/en/guides/curl-errors.html)

Next step

## Repeat this on your own API

Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.

[Download Free](https://checkcraft.ru/en/download-checkcraft.html#free-download) · [Download and first run](https://checkcraft.ru/en/download-checkcraft.html)

No sign-up or email needed, the archive is ready in a couple of minutes. See the [edition limits](https://checkcraft.ru/en/pricing.html).

## Continue with a related task

[Create a local API mock server](https://checkcraft.ru/en/guides/local-api-mock.html) · [cURL examples: GET and POST requests with JSON on Linux, Windows and PowerShell](https://checkcraft.ru/en/guides/curl-post-json.html) · [Chain API requests with extracted variables](https://checkcraft.ru/en/guides/api-request-chains.html) · [Validate API status codes, headers and response time](https://checkcraft.ru/en/guides/http-response-checks.html) · [Verify database persistence after an API request](https://checkcraft.ru/en/guides/api-database-verification.html)

Start with the linked example and compare its result with your own test requirement.

Ask a person

## Get help with your first test

Tell us what you want to test or where you got stuck. We can help you start Checkcraft, choose an example and understand your first run. You can ask before downloading.

[Ask in Telegram](https://t.me/checkcraftchat)Send an email

The Telegram group is public: do not post passwords, tokens or confidential work data. A description of your task is enough to start.

You can also email us support@checkcraft.ru

Page card: /ai/pages/en/guides/webhook-testing.md
