Glossary
Webhook: an HTTP callback sent when an event happens
A webhook is an HTTP request a service sends to your URL when an event occurs. Payloads, signature checks, retries and deduplication, with a signing example.
Updated 2026-11-23
A webhook is a callback over HTTP. You give a service a URL, and when an event occurs it sends a POST request with a JSON description to that URL. You are told when something happens instead of repeatedly asking.
How it works
The usual contract has four parts: the event, the payload, the proof of origin and the retry policy.
| Part | Typical design |
|---|---|
| Event | A named type such as bulk.completed |
| Payload | JSON with an id, a type, a timestamp and the data |
| Authenticity | A signature header computed with a shared secret |
| Delivery | Retried when your endpoint does not answer with a 2xx |
Qelka uses this shape. The events are bulk.completed, sent when a bulk job finishes, and credits.low, sent when the balance falls under 10% of the plan's monthly credits. Each payload has id (starting with evt_), type, created_at and data. The X-Signature header holds a timestamp and a v1 value, the hex HMAC-SHA256 of <t>.<raw body> keyed with the webhook's secret. Verify it against the raw bytes, with a 5-minute tolerance, using the SDK's verifyWebhook or your own code:
import { createHmac, timingSafeEqual } from 'node:crypto'
export function isValid(rawBody, timestamp, signature, secret) {
const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex')
const a = Buffer.from(expected)
const b = Buffer.from(signature)
return a.length === b.length && timingSafeEqual(a, b)
}
Answer with a 2xx within 10 seconds, then do heavy work afterwards. A failed delivery is retried up to 5 times with increasing delays, so the same event can arrive more than once and out of order. Deduplicate on the event id, see idempotency key, and rely on created_at and the state in data rather than arrival order.
Security basics: serve the endpoint over HTTPS, keep the secret out of code and logs, parse the body only after verifying, and treat the User-Agent as a label, not authentication. Full details are in webhooks.
Why it matters for validation
Validation work is often long: cleaning a very large list of addresses cannot finish inside one HTTP call. Qelka's bulk jobs run in the background and tell you through a webhook when done, so your system can fetch the results without polling. The credits.low event lets you top up before calls start failing with insufficient_credits.
A solid handler:
- Read the raw body and verify the signature.
- Look up the event
id; stop if seen. - Store the event and answer
200. - Process asynchronously, and tolerate retries.
Use rate limiting on your own endpoint too, since it is public.
Related
Frequently asked questions
What is a webhook?
How do I verify a webhook is genuine?
Why do I receive the same webhook twice?
Put this check in your product
Get an API key in under a minute. 100 free credits every month, no card required.
- 100 free credits a month
- No card
- Test keys spend nothing
- Cancel any time