Marcelo Pastorino, Software Developer

Webhook

An HTTP callback that notifies another system when an event occurs.

A webhook is an HTTP request sent automatically from one system to another when an event occurs. The receiver registers a URL, and the sender calls that URL after events such as payment succeeded, commit pushed, form submitted, or user created.

Webhooks are push based integration. The receiver does not poll repeatedly to discover changes. The sender pushes an event when it has something to report.

Request flow

Webhook callback flow

Good receivers acknowledge quickly, then process the work asynchronously. The sender should not wait while the receiver performs slow business work.

Webhook contract

A useful webhook contract defines more than a URL.

  • Event name and version.
  • Stable event ID for idempotency.
  • Timestamp and source account or tenant.
  • Signature scheme and secret rotation process.
  • Retry policy and timeout expectations.
  • Payload examples for success, failure, and edge cases.

Receiver responsibilities

The receiver should verify the signature, reject unknown event types, persist the event ID, and return a 2xx response only after the event is durably accepted. Slow work should move to a queue or background job.

Duplicate events are normal. Senders usually retry with at-least-once delivery, so the receiver must not assume one request equals one business effect.

Webhooks versus polling

Approach Strength Cost
Webhook Low latency, less wasted traffic Receiver must expose and secure an endpoint
Polling Simple receiver, works behind private networks Higher latency and repeated empty requests

Many integrations use both. Webhooks notify the receiver about changes, and polling or reconciliation catches missed events.

Reliability

Production webhooks need retries, signature verification, replay protection, idempotent processing, and observability. See webhook reliability patterns for the deeper implementation checklist.

See also

  • Webhook Reliability Patterns, Designing HTTP callbacks that survive retries, duplicates, and outages.
  • REST, An architectural style for networked APIs built on resources, uniform HTTP semantics, and statelessness.
  • Idempotency, Safe to run more than once without changing the outcome beyond the first successful apply.
  • At-Least-Once Delivery, A message or event is delivered one or more times; duplicates are possible.

On Wikipedia