The Callback That Replaced the Question

A webhook is an HTTP POST that one system sends to a URL registered by another system when an event occurs, reversing the direction of an ordinary API call. The receiving system does not ask whether anything changed. The sending system announces the change, and the announcement itself carries the facts the receiver needs in order to act. A webhook endures because it converts a distributed systems problem into a contract problem: the sender promises a signed, retryable notification, and everything else (ordering, recovery, truth) is deliberately left to the receiver. That division of labor explains both the durability of the pattern and the discipline it demands from every team that operates an endpoint.

Two servers exchanging an event notification across a network - Insight Crunch

The ordinary API call moves in one direction and answers one question at one moment. A client requests a representation, the server returns a representation, and the connection closes with no memory of the exchange and no obligation beyond the response. Stripe documentation for payment APIs and GitHub documentation for repository APIs both describe that request and response shape, and both providers then add webhooks precisely because the shape leaves a gap. A payment settles after the checkout page closes. A repository receives a push while no dashboard stands open. The event belongs to the sender, the consequence belongs to the receiver, and neither side can schedule the moment in advance. The callback closes the gap by giving the sender a standing address and a standing permission to speak first.

The contract framing matters because a contract names a narrow promise and leaves the remainder outside the agreement. A sender such as Shopify, in webhook documentation published by Shopify, promises delivery of an event notification to a configured address, with a payload that describes the event and a signature that authenticates the delivery. The sender does not promise that the receiver processed the event, understood the event, or recorded the event in the correct order relative to other events. Each of those obligations sits with the receiver, and mature receiving systems treat that allocation as a design input rather than a defect. The receiver builds storage before acknowledgement, verification before trust, and reconciliation before confidence. The sender builds signing, logging, and retry machinery. Neither side attempts to guarantee the whole exchange, and the exchange survives because neither side pretends to control the other.

That restraint separates a webhook from heavier integration machinery. A message broker holds state for both parties and charges operational rent for the privilege. A shared database couples release schedules across organizations that may never meet. A webhook asks for one address, one secret, and one agreement about payload shape, and the low price of entry explains adoption across payment processors, source control hosts, commerce platforms, and monitoring services. The price reappears later as receiver discipline, and sections that follow trace that price through polling economics, delivery anatomy, signatures, retries, and duplicate handling. The callback replaced the question because the question was always the expensive part, asked thousands of times for an answer that changed only a handful of times, and each empty answer still consumed bandwidth, compute, and attention on both sides of the connection.

The Problem Polling Could Not Solve

Polling asks a polite question at a fixed interval and pays full price for every repetition, including the repetitions that return an empty answer. A client that checks an order status endpoint every sixty seconds issues 1,440 requests in a single day for one order, and a platform serving 100,000 tracked orders at that interval fields 144,000,000 requests per day before any useful work begins. GitHub API guidance and Stripe API guidance both treat rate limits as a scarce resource, and rate limit budgets consumed by empty checks leave less room for reads that return new information. The arithmetic worsens in both directions at once. A shorter interval raises request volume and infrastructure cost, while a longer interval raises the average delay between an event and its discovery to half the polling interval, so a ten minute interval hides five minutes of staleness on average even when every request succeeds.

The RSS era taught the same lesson at publishing scale. Feed readers polled publisher servers on fixed schedules through the 2000s, and publishers absorbed waves of requests for feeds that had not changed since the prior check. Conditional requests and cache validators reduced the bytes transferred, yet the request itself still arrived, still consumed a connection, and still required a server side decision. API design in the same period inherited the habit because the request and response model offered no standard alternative. A client that needed to know about a payment, a shipment, or a build result had one available move, which was to ask again. Jeff Lindsay named the missing move during 2006 and 2007, writing about webhooks as a kind of callback for the web, framed around the idea that an application should be able to register an address and receive a call when something happened. ProgrammableWeb covered the concept in that period, and the coverage treated the pattern as infrastructure rather than as a feature of any single product.

Precursors had already proven the demand before the name settled. PayPal Instant Payment Notification, documented by PayPal as IPN, sent a form encoded POST to a merchant supplied address when a payment event occurred, and merchants verified the message by posting the contents back to PayPal for confirmation. The round trip was clumsy, and the encoding belonged to an earlier generation of web commerce, yet the direction of travel matched the webhook pattern exactly. The merchant stopped asking PayPal whether payment had arrived and instead waited for PayPal to announce arrival. GitHub post-receive hooks carried the same shape into software development, building on the hook scripts that version control systems such as Subversion and Git already ran on a server when a push landed. GitHub turned a local server side script into a network delivery, posting push details to registered addresses so that continuous integration servers, chat tools, and deployment scripts could react without polling the repository.

The economic argument settled the contest wherever event volume stayed low relative to check volume. Most orders do not change in any given minute, most repositories receive no push in any given hour, and most accounts produce no payment event on any given day, so a polling client spends nearly all requests confirming that nothing happened. A webhook inverts the spending profile. The sender performs work only when an event exists, and the receiver performs work only when a notification arrives. Cost follows events rather than following the clock. The trade carries a price of its own, because silence from a webhook sender is ambiguous in a way that a polling answer never is. A poll that returns no change proves the question reached the server. A missing webhook proves nothing on its own, and that ambiguity drives the logging, signing, and retry machinery that later sections describe in detail.

Anatomy of a Single Delivery

A delivery begins long before any event occurs, at registration, when a receiver supplies an address and selects the event types that address should receive. GitHub webhook documentation describes subscription by event type, with separate selections for pushes, pull requests, releases, and dozens of other repository events, and Stripe documentation describes endpoint registration scoped to named event types such as payment completion and invoice finalization. Scoping matters because an endpoint subscribed to every event type drowns in notifications that the owning service never acts upon, and each unwanted delivery still consumes verification, parsing, and storage effort. Registration also establishes the shared secret used for signing and, in many provider dashboards, a test delivery mechanism that sends a sample payload so the receiver can validate handling before real events depend on that handling.

What information does a webhook payload carry?

A webhook payload carries an event type, a unique delivery identifier, a timestamp for the event, and a structured body describing the object that changed, including its identifier, its new state, and the account or repository the object belongs to, plus headers that repeat the type and identifier for routing.

Payload construction follows the event itself. When a subscribed event occurs inside the sending system, the sender assembles a body, most often JSON, that names the event type and embeds the affected object in the shape the API would return for that object. Stripe event objects, as documented by Stripe, wrap the changed resource inside a data object and carry a creation timestamp and a request identifier where one exists. GitHub deliveries carry the repository, the sender account, and an action field that distinguishes an opened pull request from a closed one. Headers travel alongside the body and repeat the routing facts in a cheaper form. GitHub documentation names headers for the event type, the delivery identifier, and the signature, so a receiver can route, log, and verify a delivery before parsing the full body. The unique delivery identifier deserves particular attention because later deduplication depends on that identifier remaining stable across retries of the same delivery.

The POST itself is an ordinary HTTP request with an extraordinary burden, since the request is both a notification and the only copy of the facts in motion. The receiver answers with a status code, and the class of that code drives sender behavior. A response in the 200 range tells the sender the delivery succeeded and closes the attempt. A response in the 400 range often signals a permanent problem such as a malformed address or a failed validation that retrying cannot repair, though provider policies differ on which codes trigger another attempt. A response in the 500 range, a timeout, or a connection failure signals a transient fault, and the sender schedules another attempt under the retry policy covered later. Stripe documentation advises receivers to return a 200 response quickly and to perform slow processing after acknowledgement, because a receiver that finishes all work before answering risks a timeout that marks a successful processing run as a failed delivery and invites a duplicate.

Sender logging completes the anatomy, because a delivery that leaves no record cannot be investigated, replayed, or trusted. Mature providers record the delivery identifier, the target address, the response code, the response body where the receiver returns one, and the attempt number for every try. GitHub exposes delivery logs in repository settings, including request and response details, and offers redelivery from that log. Stripe exposes event and delivery attempts in a dashboard and through an API. Those logs serve the receiver as much as the sender. A receiver reconciling a missing order update searches the sender log for the delivery identifier and learns whether the fault sits in transport, in verification, or in receiver side processing. The log converts an argument between two organizations into an inspection of shared facts.

The Table That Separates Delivery Promises

The table settles a comparison that prose alone tends to blur, namely which party holds responsibility for noticing a change, how long a change waits before the receiver learns of it, and what shape the cost takes when the mechanism strains or fails.

Approach How the receiver learns Typical delay Main cost or failure shape
Polling The receiver asks on a schedule Half the polling interval on average Wasted requests and stale state
Webhook The sender posts when an event occurs Seconds Missed events when the receiver is down
WebSocket Both sides hold an open connection Near instant Connection state held on both sides
Server-sent events The sender streams over one open response Near instant One direction only and proxy limits
Message queue A broker holds messages until taken Seconds to minutes Broker operation and consumer lag
Event streaming Consumers replay a retained log Seconds Storage cost and platform weight

Reading across the rows shows that delay alone never decides the choice. WebSocket connections, standardized in RFC 6455 published by the Internet Engineering Task Force in 2011, deliver messages with minimal delay, yet both sides pay for the privilege by holding connection state open indefinitely, and that state complicates load balancing, deployment, and recovery after a network partition. Server-sent events reduce the machinery to one open response, and the one direction limit suits feeds and progress streams, while proxy behavior and connection limits narrow the range of networks the stream survives. Message queues move the burden to a broker, and systems such as Amazon Simple Queue Service, launched by Amazon Web Services in 2006, hold messages until a consumer takes them, which protects a receiver during an outage at the cost of operating or renting the broker and watching consumer lag as a permanent metric.

The webhook row stands out for the placement of its failure shape rather than for any speed advantage. Delay sits in the seconds range, behind the open connection options and level with brokered options, and the decisive fact is that a missed event during receiver downtime becomes the central hazard. Polling never misses in that particular way, because the next scheduled question discovers whatever changed during the gap, at the price of paying for every empty question. Event streaming answers the same hazard with a retained log, and platforms built on Apache Kafka, released by LinkedIn engineers in 2011, let a consumer replay history after an outage, at the price of storage and platform weight that a small integration cannot justify. The table therefore describes a spectrum of where an integration stores its safety. Polling stores safety in repetition, streaming stores safety in retention, queues store safety in a broker, and a webhook stores safety in a contract plus receiver side reconciliation. No row removes the need for a recovery path. Each row only chooses which recovery path the operators will maintain, which team will staff that path, and which failure will wake that team first.

Signatures and the Proof of Origin

An address that accepts POST requests from the public internet accepts requests from anyone who learns the address, and address secrecy alone provides thin protection because addresses leak through logs, screenshots, configuration files, and staff turnover. Signing replaces secrecy with proof. At registration the sender and receiver share a secret known to both parties and to no one else. For each delivery the sender computes a hash based message authentication code, HMAC, over the raw body of the request, using the secret as the key, and places the resulting value in a header. The receiver computes the same HMAC over the raw body exactly as received, compares the computed value against the header value using a constant time comparison, and rejects the delivery when the values differ. Raw body handling decides success or failure in practice, because a framework that parses JSON and reserializes the object before verification changes whitespace or key order and breaks an otherwise valid signature.

Stripe documents the pattern with a signature header that carries a timestamp and one or more signature values, and Stripe libraries verify the signature against the raw payload and the endpoint secret. GitHub documents a signature header computed with HMAC and the SHA-256 algorithm, with an earlier SHA-1 header retained during a transition period, and GitHub guidance directs receivers to verify before acting on any delivery content. Both providers pair the signature with a timestamp or a delivery record so that a captured delivery cannot be replayed indefinitely. Timestamp tolerance handles the replay window directly. The receiver checks the signed timestamp against receiver time and rejects deliveries older than a tolerance window, commonly five minutes in Stripe documented practice. An attacker holding a captured request and body then owns a credential that expires within minutes, and a legitimate retry that arrives inside the window still verifies, which balances fraud resistance against the clock skew and queue delays that real networks produce.

Key handling separates careful operators from careless ones. A secret that never rotates becomes a permanent credential, and a leak discovered after a year of deliveries forces a painful choice between rejecting legitimate traffic and accepting forged traffic. Providers that support two active secrets at once let a receiver rotate without a gap, accepting deliveries signed under either secret during the transition and retiring the older secret after senders confirm the change. Svix, a sending infrastructure company founded in 2020, built a business around operating that machinery for other companies, handling signing, retries, and delivery logs as a managed service. The Standard Webhooks specification effort of 2023, backed by Svix and adopted or endorsed by companies including Stripe in public discussion of the effort, attempted to fix the shared parts of the pattern in one document, covering header names, signature construction, and timestamp handling, so that a receiver could verify deliveries from many senders with one library and one mental model.

Proof of origin still proves less than many receivers assume. A valid signature establishes that the holder of the secret produced the delivery and that the body survived transit unchanged. A valid signature says nothing about whether the event description matches the sender internal state at the moment of reading, nothing about whether a later delivery will correct an earlier one, and nothing about events that never produced a delivery at all. Receivers that treat a verified webhook as ground truth inherit every sender side fault in silent form. Receivers that treat a verified webhook as a strong hint, and then confirm critical state through an API read before releasing money or goods, keep the signature in its proper place. The signature guards the door. Verification of state remains a separate act, and the distinction returns in force when retries and duplicates enter the picture.

Retries, Backoff and the Long Tail of Failure

Failure is the normal operating condition of a webhook fleet rather than an exception within it. Receivers deploy, restart, exhaust database connections, hit rate limits imposed by their own dependencies, and sit behind load balancers that drain connections during maintenance. A sender that attempted each delivery exactly once would lose events to every one of those routine disturbances, so senders retry, and the shape of the retry schedule decides how much load a struggling receiver absorbs and how long an event can remain undelivered before the sender gives up. Exponential backoff spaces attempts by doubling or otherwise growing the interval between tries, so early retries arrive within seconds or minutes while later retries arrive hours apart. The early cluster catches brief restarts, and the widening gaps stop a sender fleet from hammering a receiver that needs time to recover.

Jitter refines the schedule by adding controlled randomness to each interval. Without jitter, thousands of deliveries that failed during the same receiver outage share the same retry instant, and the receiver faces a synchronized wave at the moment of recovery, a pattern described in architecture writing from Amazon Web Services on backoff and jitter published in 2015 by Marc Brooker. Random spread converts the wave into a slope. Provider schedules differ in detail, and the differences matter to receiver design. Stripe documentation describes retry attempts over a window extending across days in live mode, with a compressed schedule in test mode. GitHub documentation describes a far shorter patience, with failed deliveries available for manual redelivery from the delivery log rather than automatic attempts stretching across days. Shopify documentation describes its own attempt schedule across a multi day window with eventual endpoint disabling after sustained failure. A receiver built against one provider schedule and then connected to another provider inherits mismatched assumptions about how long an outage can last before events stop arriving automatically.

The long tail of the schedule carries a business meaning that pure engineering language hides. An event retried across three days can arrive after the customer has contacted support, after a refund has been issued through another channel, and after the receiver has already reconciled the account by hand. The late delivery is not wrong, and the payload still describes a real event, yet acting on the delivery without checking state can undo a manual repair. Retry windows measured in days therefore demand the same state confirmation discipline that signatures demand, and the two demands compound. The receiver must verify origin, check freshness, confirm current state, and only then apply the change. Each layer exists because the layer before it proved insufficient under production conditions, and the accumulated layers explain why experienced integration teams describe webhook handling as a small distributed system rather than as a form endpoint.

Dead letter handling names the end of the schedule, the point where automatic attempts stop and a human or a separate process takes ownership of the undelivered event. Some providers expose failed deliveries in a dashboard with a manual resend control, some emit a separate notification after final failure, and some simply mark the delivery failed in the log. The distinction between a retry and a duplicate decides whether dead letter recovery is safe. A retry is a repeated attempt at the same delivery, carrying the same delivery identifier, and a receiver that deduplicates on that identifier can accept retries freely. A duplicate in the dangerous sense is a second logical delivery of the same event under a new identifier, produced when a sender creates the event twice, when a manual resend generates a fresh identifier, or when a receiver processed the first delivery and then returned an error by mistake. Retry safety is a solved problem at the receiver. Duplicate safety requires the deeper idempotency machinery that the next section takes up.

Idempotency and the Second Delivery

At-least-once delivery is the honest contract of the webhook pattern, and providers state the contract in plain terms in developer documentation. Stripe documentation warns receivers to expect duplicate events and to handle them by recording processed event identifiers. GitHub documentation treats redelivery as a normal operation available from the delivery log. The contract sounds like an admission of weakness and instead functions as an accurate description of what two systems connected by an unreliable network can promise each other. A sender that receives no acknowledgement cannot distinguish a lost request from a lost response, and a sender that receives an acknowledgement cannot know whether the receiver committed the work before or after sending that acknowledgement. Any sender policy then chooses between risking a loss and risking a repetition, and every major provider chooses repetition, because a receiver can defend against repetition while no party can recover an event that vanished without a trace.

Receiver side deduplication converts that choice into workable engineering. The receiver stores each delivery identifier, or each event identifier where the provider supplies a stable one, in a table with a uniqueness constraint, and the insert happens in the same transaction as the state change the event triggers, or before processing with a recorded status that later attempts can read. A second arrival then meets a record of the first arrival and exits as a no operation after acknowledgement, returning success so the sender stops retrying a delivery that already took effect. The deduplication window needs a deliberate length. A window of twenty-four hours covers most retry schedules, while providers with multi day retry windows require a longer window, and storage cost for identifiers stays trivial next to the cost of one double applied payment or one double shipped order. Teams that skip the table and instead check current state before acting gain partial protection, since a state check catches a second application after the first one completed, yet a race between two near simultaneous deliveries defeats a check that is not backed by a uniqueness constraint.

Exactly-once delivery over an open network is not obtainable, and the classic statement of the barrier is the Two Generals problem, a thought experiment in distributed computing literature dating to the 1970s, in which two commanders coordinating by messenger can never reach guaranteed agreement because every confirmation itself requires a confirmation. The webhook setting maps onto the problem without distortion. The sender plays one general, the receiver plays the other, and the acknowledgement is the messenger whose arrival can never be confirmed by any finite exchange. Protocols can drive the probability of error toward zero and engineering can make duplicates harmless, and neither achievement changes the underlying limit. Honest system design starts from the limit rather than from the marketing language that sometimes surrounds messaging products, and the idempotent receiver is the practical form that honesty takes.

The second delivery, handled well, becomes a source of confidence rather than a source of fear. A receiver that verifies signatures, deduplicates on stable identifiers, confirms state before applying financial changes, and reconciles against sender records on a schedule can treat every arrival pattern the network produces as a routine case. Missed deliveries surface in reconciliation, duplicates collapse in the deduplication table, late deliveries meet a state check, and forged deliveries fail verification. The contract from the opening section then holds in full. The sender promised a signed, retryable notification and kept that promise. The receiver accepted responsibility for ordering, recovery, and truth, and built the machinery that responsibility requires. Webhook reliability, seen from the receiver side, is not a property the sender delivers. Reliability is a property the receiver constructs, one safeguard at a time, out of a notification that promised very little and delivered exactly that.

Ordering, Gaps and the Event That Never Arrives

A webhook delivery carries no promise about the order in which it reaches a receiver, and that absence shapes every serious receiver design. A sender may emit an event for a created object, then an event for an update to the same object, then an event for its deletion, yet network delay, retry timing, and parallel dispatch can deliver the update after the deletion or the creation after the update. HTTP itself offers no sequencing across separate connections, and most senders open deliveries in parallel to protect throughput, so arrival order reflects transport conditions rather than the order in which state changed. Stripe documentation describes events as potentially arriving out of order, and GitHub documentation gives the same warning for repository events, because both platforms dispatch at scale and cannot serialize the world through a single pipe without creating a bottleneck that harms every customer. The receiver that assumes arrival order equals state order builds a quiet defect into its data, one that surfaces only when a delayed retry resurrects a record that a later event had already closed.

Senders offer partial repairs, and each repair helps without restoring a guarantee. A sequence number assigned by the sender lets a receiver detect a gap or a stale delivery, provided the sequence is scoped clearly, since a global sequence across unrelated objects forces the receiver to track numbers that carry no meaning for the object at hand. An object-scoped sequence, such as a version field on an invoice or an order, gives a cleaner test, because the receiver can compare the incoming version with the stored version and discard or defer anything older. Timestamps help in a weaker way. A creation timestamp records when the sender believes the event occurred, and a receiver can use it to order a display or to flag an implausibly old delivery, yet clock skew between systems, delays inside the sender queue, and retries that preserve the original timestamp all limit what a timestamp can prove.

Reconciliation closes the gap that ordering tools leave open. A receiver that treats each notification as a hint schedules a periodic fetch of authoritative state from the sender API, compares that state with its local copy, and repairs drift without waiting for another delivery. Shopify store integrations use this pattern when an orders create notification is missed, because a scheduled query for orders changed since a stored checkpoint recovers the missing record through a channel the receiver controls. Payment and subscription systems apply the same discipline at billing boundaries, where a nightly comparison between local entitlements and the processor record catches the subscription cancellation that never arrived.

The event that never arrives deserves the same design attention as the event that arrives twice. A sender may drop a delivery after exhausting retries, a receiver endpoint may return errors during a deploy, a firewall rule change may block a sender address range, and a queue inside the sender may discard low priority events under load. None of those failures announces itself to the receiver, because silence carries no signal. The durable defense combines several habits. Delivery logs exposed by senders such as GitHub and Stripe let operators compare what the sender attempted with what the receiver recorded. Alerting on an unexpected fall in event volume catches a broken endpoint faster than alerting on errors alone. Above all, the receiver holds its local state as provisional, a cache of a truth that lives with the sender, and that posture turns a missing notification from a silent corruption into a delay that reconciliation eventually repairs.

The Receiver’s First Second

The first second after a request lands decides whether a webhook integration behaves like a reliable partner or a recurring incident. A sender opens a connection, posts a payload, and waits for a response inside a timeout window that the sender sets and the receiver does not control. GitHub allows a short window measured in seconds for webhook responses, Stripe waits longer but still closes slow deliveries and marks them failed, and Shopify expects a response within a few seconds before treating the delivery as unsuccessful. A receiver that performs database writes, external API calls, image processing, or email sending inside the request path spends that window quickly, and a burst of events during a busy period stretches each response until timeouts multiply. Each timeout invites a retry, each retry adds load, and the receiver enters a spiral where the work caused by deliveries prevents the acknowledgment that would stop further retries.

Why should a receiver answer before it processes the event?

A receiver answers before processing because the sender timeout rewards speed and punishes thoroughness in the request path. A fast success status ends the delivery, stops retries, and preserves the payload in an internal queue where workers can process it without pressure from a closing connection or a watching sender clock.

The pattern that survives load separates acknowledgment from work. The endpoint validates the signature, performs the cheapest possible checks on payload shape, writes the raw event to durable storage or pushes it onto an internal queue such as Amazon SQS, RabbitMQ, or a Kafka topic, and returns a success status in the 200 range. Processing then happens in worker processes that read from the queue at a pace the downstream systems can sustain. That separation buys several properties at once. Workers can retry a failed job without involving the sender, operators can pause processing during a downstream outage while deliveries accumulate safely, and engineers can replay stored events after fixing a defect. The queue also absorbs bursts, so a flash sale fans out into steady work rather than a spike that topples the endpoint.

Speed at the edge demands discipline about what the endpoint refuses to do. Signature verification belongs in the request path because accepting an unsigned event into the queue poisons every later stage, yet even verification stays cheap, a single HMAC computation over the raw body with a stored secret. Anything heavier moves downstream. Enrichment calls to the sender API, lookups against slow tables, rendering, and notification fan-out all wait for the worker. The endpoint also needs a clear rule for malformed payloads, so many receivers accept a defective payload, record the defect, and route it to a dead letter store rather than inviting a retry storm over a body that will never parse. Idempotency checks sit at the boundary as well, since a quick lookup of the event identifier prevents the most common duplicate, the retry that follows a lost response, from entering the queue twice.

Failure handling inside the first second shapes sender behavior in ways operators sometimes miss. A success status returned before durable storage commits risks the worst outcome, an acknowledged event that vanishes when the process crashes, so the write to the queue or table must complete before the response leaves. A server error status signals a transient problem and most senders schedule another attempt with backoff, which suits a brief outage. A redirect response confuses many senders, and several platforms treat redirects as failures, so endpoints should answer directly at the registered address. The receiver that respects the first second avoids automatic disabling that platforms such as GitHub and Shopify apply to failing endpoints, and keeps the event stream flowing into machinery designed to handle it.

Money on the Callback: Payments

Payment notifications carry higher stakes than any other common webhook class because the event being reported moves money, grants access, or settles a debt. A missed or mishandled payment event can leave a customer charged without a delivered product, a subscription active after a failed renewal, or a ledger that disagrees with the processor record at audit time. The history of the pattern runs through PayPal Instant Payment Notification, a service PayPal operated from the early 2000s onward, in which PayPal sent a POST to a merchant listener URL for each transaction and the merchant validated the message by posting the data back to PayPal for confirmation. That round trip, cumbersome beside modern signature schemes, established the enduring rule for the class. A notification announces that something happened, and the merchant system then verifies the claim through a channel it trusts before acting on it.

Stripe built its event system on the same principle with a broader vocabulary. Stripe emits events with types such as payment_intent.succeeded, payment_intent.payment_failed, charge.refunded, invoice.paid, invoice.payment_failed, customer.subscription.updated, and checkout.session.completed, each carrying an event object that references the underlying resource rather than serving as the final record of it. The disciplined receiver verifies the Stripe signature with the endpoint secret, records the event identifier for deduplication, returns a success status quickly, and then retrieves the payment intent, invoice, or subscription from the Stripe API to read the authoritative state before fulfilling an order or extending access. The fetch matters because events can arrive out of order, because a retry can deliver an older event after a newer one, and because the payload snapshot reflects the moment of emission rather than the state after later adjustments such as a partial refund or a dispute opened through the card network.

Card payments add a further layer, since authorization, capture, and settlement unfold as separate steps and a customer sees a confirmation long before the merchant receives final funds. A shopper who taps a card or phone completes the contactless payment mechanism at a terminal in a second, yet the merchant entitlement decision usually waits on the processor notification and the verified fetch that follows it. That separation protects both sides. The merchant avoids shipping goods on the strength of an authorization that later fails capture, and the customer record reflects disputes and refunds that arrive through processor events days after the original purchase. Adyen and Checkout.com follow a similar notification model, with signed notifications and a receiver duty to acknowledge in an exact expected format.

Disputes and chargebacks show why the verified fetch rule has no safe shortcut. A charge.dispute.created event from Stripe signals that a cardholder has challenged a payment through the issuing bank, and the funds may already have left the merchant balance before the merchant system reads the news. A receiver that treats the notification body as complete truth may miss the dispute deadline evidence requirements recorded on the dispute object itself, which only the API fetch reveals in full. Duplicate handling also carries financial weight. A payment_intent.succeeded event delivered twice must produce one fulfillment, one receipt, and one ledger entry, so receivers key fulfillment on the payment identifier rather than on delivery count. Reconciliation completes the picture at the close of each settlement cycle, when finance teams compare processor payout reports against internal records and investigate every difference. The webhook stream accelerates the work and keeps customer facing state fresh, while the ledger of record still comes from verified fetches and settlement reports, a division of labor that auditors from firms such as Deloitte and PwC recognize because it mirrors the control structure of any system where an external party holds the authoritative balance.

Builds That Start Themselves: Code Platforms

Software delivery pipelines begin with a notification more often than with a human command. Version control platforms adopted the callback pattern early through post-receive hooks, server side scripts that ran after a repository accepted a push, and the hosted platforms generalized the idea into webhooks that any registered system could consume. A push event to GitHub carries the repository name, the branch reference, the before and after commit identifiers, and the list of commits with their authors and messages, and that single payload serves as the starting gun for systems that never saw the code before the event arrived. Continuous integration services such as CircleCI, Travis CI, and GitHub Actions subscribe to push and pull request events, fetch the named commit, and run build and test suites whose results then travel back to the platform as status checks attached to the commit. The loop feels instantaneous to a developer, yet every step depends on the notification leaving the platform, crossing the network, and being accepted by the receiving service.

Deployment pipelines extend the same chain further from the original event. A merge to a main branch fires a webhook that a deployment platform such as Vercel, Netlify, or Render consumes to build and publish a site, while an infrastructure pipeline may wait for a release event or a tag creation event before promoting an artifact through staging into production. Each handoff multiplies the value of the first notification and also its blast radius. A delayed push event delays every downstream stage at once, and because the stages wait silently, the failure presents as absence rather than error. Builds that never start generate no failing logs, and teams learn to check the notification layer early whenever a pipeline appears idle for no clear reason.

The dependence became visible as plain history on December 2, 2026, when a database failure at GitHub delayed webhooks and Actions for roughly four hours before recovery the same day. Pushes landed and code sat safely in repositories, yet the automation that developers treat as automatic stalled because the events that trigger it moved slowly or not at all. The incident illustrates the contract at the center of the pattern. The platform promises to emit a signed, retryable notification, and the surrounding ecosystem builds elaborate machinery on the assumption that the promise holds. When the promise wobbles, the machinery does not degrade into a slower version of itself. It waits, because waiting is the only behavior available to a system designed around being told.

Mature teams design around that fragility instead of trusting the chain blindly. A scheduled reconciliation job compares the newest commit on important branches with the newest build record and starts a build when the two disagree, which converts a lost push event from a silent stall into a delayed start. Manual trigger endpoints give operators a way to restart a pipeline without fabricating an event. Delivery logs in the GitHub settings interface let an engineer inspect the exact payload and response for a failed delivery and redeliver it with a click, a feature that turns many incidents into short investigations. Status webhooks flowing in the reverse direction, from the integration service back to the platform, receive the same care, because a lost status event leaves a pull request showing a pending check that finished long before. The push event remains the cheapest coordination mechanism in software delivery, a small message that sets large machinery in motion, and the engineering maturity lies in remembering that small messages can fail quietly.

Messaging, Commerce and Connected Devices

Commerce platforms turned the webhook into the backbone of store automation. Shopify sends webhooks for topics such as orders/create, orders/paid, orders/fulfilled, products/update, customers/create, and app/uninstalled, and a typical store may register dozens of endpoints across separate applications handling fulfillment, accounting, email marketing, fraud screening, and warehouse management. One order event fans out to a shipping provider that books a label, an accounting package that records revenue, a warehouse system that reserves stock, and a messaging tool that sends the customer a confirmation, each subscriber acting independently on the same payload. Shopify enforces delivery expectations with response deadlines and retry attempts, and it removes or disables subscriptions that fail persistently, so application vendors treat endpoint health as part of the product rather than as an operational detail. The uninstall topic carries special weight, because it starts the clock on data deletion duties that privacy law attaches to the departure of a merchant.

Chat platforms use the same mechanism to make software feel conversational. Slack operates an Events API in which Slack sends an HTTP POST to a registered request URL whenever subscribed activity occurs, including message events in channels the application can see, reactions added to messages, and application mentions that summon a bot by name. Slack signs each request with a signing secret, attaches a timestamp that receivers check for freshness, and expects an acknowledgment within three seconds, after which it retries the delivery and may mark the endpoint as unreliable. The three second rule produced a recognizable architecture across the Slack ecosystem, where the endpoint records the event, answers at once, and performs the real conversational work in background processes that post a reply through the Slack Web API when ready. Discord and Microsoft Teams expose comparable surfaces, and Slack pairs the push model with a URL challenge in which the endpoint must echo a challenge value before the subscription activates.

Connected devices add physical consequences and awkward networks to the pattern. A sensor gateway, a vehicle telematics unit, or a smart lock rarely maintains a dependable inbound connection, so the device reports to a cloud service and that service emits webhooks to customer systems when readings cross thresholds or states change. Particle and Twilio offer device and messaging event callbacks in this shape, and industrial monitoring vendors use the same structure to report pump failures, cold storage temperature excursions, and door events to maintenance systems. The payloads stay small, often a device identifier, a reading, and a timestamp, because the authoritative history lives in the platform time series store and the webhook serves as an alarm rather than a record.

Fan-out ties the three domains together and explains why the pattern scales socially as well as technically. A single event source with many subscribers lets each team or vendor integrate once and receive everything it needs, without the source team building custom exports for each consumer. Intermediary services such as Zapier, Make, and Workato built businesses on that property, subscribing to events from hundreds of applications and routing them into thousands of others through user configured automations. The fan-out also concentrates risk. A malformed event or a compromised endpoint affects one subscriber, yet a source outage silences every subscriber at once, and a payload format change ripples across an ecosystem of receivers who parse fields the source team considered internal. Platform operators respond with versioned APIs, advance deprecation notices, and event schemas published as contracts. The pattern endures across messaging, commerce, and devices because the economics repeat everywhere. The party that knows something changed tells the parties that care, once, in a format they agreed in advance, and each listener decides what the news means for its own work.

The Alternatives and Where Each One Wins

Polling retains a strong claim in many designs, and dismissing it as a crude predecessor misreads its advantages. A client that polls an API on a schedule controls its own timing, needs no public endpoint, passes through firewalls and network address translation without special arrangement, and recovers from missed changes automatically because each request asks for current state rather than for a history of notifications. For data that changes rarely, for integrations behind strict network policy, and for prototypes where operating a secure public endpoint costs more than the traffic it saves, polling wins on simplicity and auditability. Its costs are equally concrete. Latency averages half the polling interval, most requests return no change, and providers enforce rate limits that punish aggressive schedules, as the published limits for the GitHub and Shopify APIs make clear. Polling also reports state rather than events, so a transient condition between two polls may never surface, while a webhook stream preserves each transition as its own message.

Persistent connections serve the cases where a server must reach a client that cannot accept inbound requests, above all the browser. WebSockets, standardized in RFC 6455 in 2011, hold a bidirectional connection open over which either side can send messages at any moment, and chat products, collaborative editors, and trading interfaces rely on that property to deliver updates with low latency. Server-sent events offer a narrower tool, a one way stream from server to client over ordinary HTTP, well suited to feeds, progress reporting, and live text, with automatic reconnection built into the browser EventSource interface. Neither technology replaces webhooks between servers, since a WebSocket connection belongs to a session and dies with it. The mature event-driven architecture literature treats browser push and server callbacks as complementary layers, one serving human attention in real time and the other serving system coordination with durable, retryable messages.

Message queues and retained logs occupy the ground where delivery guarantees matter more than immediacy of integration. A queue such as Amazon SQS, RabbitMQ, or Google Cloud Pub/Sub gives producers and consumers a brokered channel with acknowledgment, redelivery, ordering options in FIFO configurations, and dead letter handling, at the price of operating or purchasing the broker and requiring every participant to speak its protocol. Retained event logs, represented by Apache Kafka and by event streaming with Azure Event Hubs, keep events in an ordered, replayable store that consumers read at their own pace, which transforms integration history into an asset that new consumers can process from the beginning. Those systems outperform webhooks inside one organization, where a platform team can mandate tooling and identity controls. Between organizations they meet friction, since few partners will install a Kafka client or accept queue credentials to receive order notifications, while nearly every partner can expose an HTTPS endpoint. The webhook therefore survives as the intercompany protocol of least resistance, and many architectures combine the two, receiving webhooks at the edge and republishing them immediately onto an internal queue or log where stronger guarantees take over.

Choosing among the patterns is an exercise in matching failure modes to tolerance. A team that cannot operate a public endpoint polls, a product that must update a browser display opens a WebSocket or an event stream, and a platform coordinating high volume internal services invests in a broker or a log. Hybrid shapes dominate in practice. Stripe notifies by webhook and offers event listing through its API for recovery, Shopify pushes order events and still expects applications to query for anything missed, and Slack pushes events while keeping message history retrievable through its Web API. The webhook keeps winning the partner notification slot because its assumptions are the thinnest of all, an address, a secret, and a promise to try again.

Security Beyond the Signature

Transport encryption forms the floor of webhook security, and every serious sender requires an HTTPS endpoint with a valid certificate so that payloads and secrets travel inside TLS rather than across the network in readable form. Encryption in transit still leaves the receiver with an authentication problem, because any party that learns an endpoint address can post a forged payload to it. The signature schemes described across sender platforms answer that problem at the message level, yet several duties remain after signature verification is in place. The receiver rate limits unauthenticated traffic, rejects oversized bodies before parsing, and logs failed verification attempts as a security signal rather than as routine noise.

Replay protection extends authentication across time. A signature proves that a payload came from the sender, but a captured genuine payload resent hours later still carries a valid signature, and a receiver that acts on it may repeat a fulfillment, reopen a closed ticket, or restore a revoked access grant. Senders such as Stripe include a timestamp inside the signed content and advise receivers to reject deliveries whose timestamp falls outside a tolerance window of a few minutes, which bounds the useful life of a captured message. Event identifier deduplication supplies the second layer, because a replayed delivery carries the same identifier as the original and a receiver that records identifiers can refuse the repeat even inside the window. Secret rotation addresses a slower threat. Endpoint secrets leak through logs, screenshots, contractor access, and repository mistakes, so platforms support overlapping secrets during a rotation window, letting the receiver accept signatures from the old and new secrets briefly while senders switch over.

Letting users register arbitrary callback URLs creates the most distinctive risk in the pattern, server-side request forgery, because the sender platform can be induced to make requests to addresses the registrant could not reach directly. A malicious registration might point a webhook at an internal metadata service, a private administration interface, or a localhost address on the sender infrastructure, and the delivery attempt then originates from inside the sender network perimeter. The standard mitigations operate at mechanism level. The platform validates registration targets against an allow list or a block list that excludes private and link local address ranges, resolves hostnames and checks the resulting addresses at delivery time as well as at registration time to counter DNS rebinding, and pins the validated address for the connection. Egress controls route webhook traffic through a dedicated proxy with its own network policy, so even a validation failure meets a second barrier. Response handling limits complete the posture. The sender caps response size, refuses to follow redirects or follows only a small number to public addresses, sets short timeouts, and ignores response bodies beyond the status code, which prevents a hostile endpoint from tying up delivery workers or smuggling content into logs and dashboards.

Receiver side hygiene closes the remaining gaps. Webhook endpoints sit behind the same observability and alerting as any production surface, with delivery volume anomalies treated as incidents because a sudden flood may indicate a misconfigured sender, a replay attempt, or a compromised secret. Payment events reference transactions and commerce events carry customer names and addresses, so retention stays short, access stays narrow, and raw payload stores encrypt at rest. Test endpoints and sandbox secrets belong outside production paths, since a test secret accepted by a production endpoint quietly defeats the signature system. Every registered endpoint across Stripe, GitHub, Shopify, and internal platforms has a named owner, a purpose, and a review date, and orphaned subscriptions are removed when found. Security for webhooks is therefore a stack of modest controls that together preserve the property the whole pattern depends on, namely that a small message arriving from the network can be trusted enough to start real work.

The Operational Burden Nobody Budgets For

The demonstration version of a webhook fits on a whiteboard, and the production version consumes a share of an engineering budget that no planning document assigns to it in advance. The gap between the two versions lives in upkeep. Every registered endpoint is a promise made by another organization about a URL, a certificate, a firewall rule and a team that still exists, and each of those elements decays on its own schedule. Transport Layer Security certificates expire on cycles as short as 90 days under automated issuance from automated certificate authorities, and a receiver that lets a certificate lapse turns a healthy subscription into a stream of failed deliveries that the sender records and the receiver never sees. Domain registrations lapse, staging hosts get decommissioned, and load balancer rules change during unrelated migrations, so an endpoint that answered correctly for 2 years can begin returning connection refusals on an ordinary Tuesday without any change to the integration itself.

Silent subscriber rot is the slower version of the same failure. A customer registers a callback URL during onboarding, the engineer who built the receiving service leaves, the service is replaced during a replatforming project, and the registration survives in the sender database long after the receiving system has been retired. The sender keeps delivering, or attempting delivery, to an address that resolves to nothing or, worse, to a reassigned host that accepts the connection and discards the payload. Stripe, GitHub and Shopify all expose delivery logs in their developer dashboards partly because this rot is universal, and all three allow a receiver to inspect individual attempts, response codes and timestamps rather than trusting that a subscription record implies a living endpoint. The inspection tooling exists because the registration record alone proves almost nothing about present health.

Debugging across organizational boundaries multiplies the cost of every incident. When a payment event fails to arrive, the receiver support team sees an order that never updated, while the sender support team sees a delivery attempt that returned a 500 response from a server it does not control. Neither side holds the full picture. The receiver cannot inspect the sender queue, the sender cannot inspect the receiver logs, and the conversation between them proceeds through ticket exchanges in which each party attaches partial evidence gathered at different times. A delivery identifier and a shared timestamp become the only reliable meeting point, and integrations that lack one of those two anchors turn a 20 minute diagnosis into a correspondence lasting days. Mature senders learned to publish per delivery records with request headers, response bodies truncated to a safe length and retry history, because the alternative is support staff on two continents reconstructing a single HTTP exchange from memory and screenshots.

The dashboards themselves carry a cost that planning rarely counts. A sender delivering millions of events per day must store attempt records, index them by account and delivery identifier, retain them across a realistic dispute window and expose them through an interface customers can use.

Support tickets that begin with a missing event follow a recognisable shape, and the shape reveals the cost asymmetry between sending and receiving. The sender bears a fixed, predictable cost per delivery, measured in fractions of a cent of compute and bandwidth. The receiver bears the investigative cost, because the missing event represents a sale unrecorded, a licence unprovisioned or a shipment unreleased inside the receiver business. The party with the least control over delivery carries the largest loss from its failure, and that asymmetry explains why receivers build reconciliation jobs, manual repair tools and escalation paths that dwarf the original integration in size. The callback itself was the cheap part. Living with its failure modes is the expense, and the expense arrives after the launch announcement, spread across years of small incidents that no single budget line ever anticipated.

Standards That Tried to Tame the Callback

Every generation of practitioners rediscovers the same inconsistencies in webhook practice, and several organized efforts have tried to replace private convention with shared specification. Senders name the same event differently, sign payloads with incompatible schemes, retry on unrelated schedules and describe deliveries in formats that force each receiver to write a fresh adapter for every integration.

WebSub travelled furthest through formal process. The protocol began as PubSubHubbub, developed around 2009 by Brad Fitzpatrick and Brett Slatkin, and it introduced a hub that sits between publishers and subscribers, verifying subscription intent through a callback challenge and distributing notifications when a topic updates. The World Wide Web Consortium published WebSub as a Recommendation in January 2018, giving it the highest maturity level that body assigns. WordPress and a number of feed oriented services implemented it, and its design solved real problems around discovery and subscription verification that plain callbacks leave to private arrangement. Yet the hub model asked publishers to adopt an intermediary and subscribers to speak a subscription protocol, and most commercial platforms preferred direct registration inside their own dashboards, where the relationship with the customer already lived.

What is the difference between a webhook and WebSub?

WebSub adds a hub between publisher and subscriber, so discovery, subscription intent and distribution pass through an intermediary that verifies callbacks and fans out notifications. A plain webhook keeps registration direct between two parties, with no hub, no discovery document and no shared subscription protocol governing the exchange between them at all.

CloudEvents attacked a different layer of the disorder. The Cloud Native Computing Foundation published CloudEvents 1.0 in October 2019 through its Serverless Working Group, and the specification defines a common envelope for event data rather than a delivery protocol. A CloudEvent carries attributes named id, source, type and time, with the payload held in a data field, so a receiver can route, log and deduplicate an event before interpreting the payload itself. Microsoft Azure Event Grid adopted the format as a native output, and Knative built its eventing model around it. The envelope standardised the shape of the message while leaving transport, signing and retry behavior to each platform, which made adoption comparatively painless and comparatively shallow at the same time.

AsyncAPI approached the problem from documentation. Where OpenAPI describes request and response interfaces, AsyncAPI describes event driven interfaces, naming channels, messages and bindings in a machine readable document that a team can publish beside its callback offering. A receiver reading a thorough AsyncAPI document learns the event catalogue and payload schemas before writing code, which removes a class of guesswork that informal documentation leaves behind. The Standard Webhooks initiative, launched in 2023 by the team behind the Svix delivery platform, aimed narrower and deeper, specifying a signing scheme built on headers named webhook-id, webhook-timestamp and webhook-signature, a defined verification procedure, and expectations for retries and endpoint behavior. Its libraries gave receivers one verification routine across participating senders, addressing the per sender cryptographic improvisation that had produced a long record of verification errors.

Adoption across all four efforts stays partial for structural reasons rather than technical ones. A standard creates value in proportion to the number of counterparties who follow it, and the largest senders hold enough market weight to treat their private conventions as the standard that receivers will follow regardless. GitHub signs with its own header scheme, Stripe with its own, and each integration ecosystem absorbs the cost because access to the platform is worth an adapter. Smaller senders gain little from compliance until receivers demand it, and receivers rarely hold the bargaining position to demand anything. The result is a layered settlement in which CloudEvents shapes some envelopes, Standard Webhooks shapes some signatures, AsyncAPI shapes some documentation, WebSub governs a shrinking feed niche, and the plain undocumented callback remains the default that every receiver must still be prepared to accept.

The Case Against the Callback, Given Its Best Form

The strongest criticism of the webhook pattern deserves presentation in its most persuasive form, because the pattern survives partly through habit and partly through the absence of a hearing for its rivals. Three positions, each held by engineers with substantial production experience behind them, argue that the callback rests on a design error, and each position identifies a real weakness that enthusiasm for the pattern tends to pass over in silence.

The retained log position begins with a claim about what a contract requires. Advocates of log based integration, a school associated with the success of Apache Kafka after its release from LinkedIn in 2011 and with Jay Kreps and his widely read 2013 essay on log structured data, argue that a notification without a replayable record behind it is an incomplete contract. A webhook tells a receiver that something happened and then discards the telling. If the receiver was down, misconfigured or simply slow, the information content of the event depends on the sender retry policy and retention window, neither of which the receiver controls. A retained log inverts that dependence. The event sits in an append only record for a retention period measured in days or weeks, the receiver reads at its own pace, rewinds after a defect and replays a week of history after a data corruption incident. On this account, the webhook is a notification that forgot to keep its evidence, and every reconciliation job receivers build is an admission that the record should have existed from the start.

The polling position defends an unfashionable virtue, namely that state authority should live in one place. Defenders of pull models point out that a receiver which polls an authoritative application programming interface always reads the sender present state, stated in full, rather than reconstructing that state from a sequence of partial change notices that may have arrived out of order or not at all. Polling carries no endpoint to secure, no signature to verify, no duplicate to suppress and no silent failure mode in which a subscription rots while both parties believe the integration is healthy. Its costs, in request volume and detection latency, are visible and predictable, and a generation of engineers trained on the failure stories of push systems regards visible cost as a form of honesty. Where the data changes slowly and the authoritative read is cheap, the polling case is not a fallback position. It is the simpler engineering decision, and the callback wins only by fashion.

The streaming platform position extends the log argument into an organizational claim. Advocates for platforms such as Kafka, Amazon Kinesis and Apache Pulsar argue that receivers should consume from a durable log operated as shared infrastructure rather than be pushed to at addresses they register and maintain. Consumption removes the sender obligation to track thousands of heterogeneous endpoints, replaces per receiver retry machinery with a single retention guarantee and gives every consumer an independent position in the stream, so one slow receiver delays nobody else.

The thesis survives these arguments in a narrowed form. Where two organizations with no shared infrastructure must exchange a small number of consequential notifications across the public internet, the log and the streaming platform both demand a platform commitment that neither party may be willing to fund for a single integration, and polling imposes latency that payment confirmation and fraud response cannot always accept. The callback endures in that gap. The narrowing is real, though. Inside one organization, or between parties already sharing a streaming platform, the case for raw callbacks weakens sharply, and the retained log critique correctly predicts that any webhook integration of consequence grows a record, a replay path and a reconciliation process around itself, rebuilding pieces of the log under private management and at private expense.

Designing a Sender That Receivers Trust

Trust in a sender is earned through behavior that a receiver can predict before anything goes wrong, and the sender that earns it treats the callback program as a published interface rather than a side effect of internal state changes. The work begins with stable event schemas. Each event type should carry a documented payload shape whose fields change only under a versioning policy stated in advance, because a receiver parser written against one shape and surprised by another fails in production at the worst available moment. Additive change, in which new fields appear and old fields keep their names and types, preserves receiver code across releases, and a sender that reserves breaking change for a new event version gives receivers a migration path measured in months instead of a breakage discovered through failed orders.

Versioning deserves the same discipline whether it rides in the event type name, a header or a payload field, provided the chosen location is documented and consistent across every event the sender emits. A receiver should never need to guess which contract a given delivery follows. Delivery identifiers carry equal weight. Every delivery, including each retry of the same event, benefits from identifiers that let a receiver distinguish a fresh event from a repeated attempt and a repeated attempt from a fresh event that resembles an earlier one, and a sender that exposes both an event identifier and a per attempt identifier removes an entire category of correspondence between support teams. Signing belongs in the first release rather than a later hardening project, because a signature scheme retrofitted onto a live integration forces every receiver to change working code under deadline, and the HMAC construction described in earlier sections costs a sender little when the verification libraries ship beside it from the start.

A documented retry policy converts receiver guesswork into planning. The sender should state the attempt count, the interval pattern, the response codes treated as success and the point at which delivery is abandoned, and then behave as the document describes, because a receiver sizing an incident response around a published schedule of 8 attempts across 24 hours makes different decisions than a receiver facing silence of unknown meaning. A delivery log that the receiver can inspect completes the policy. When a receiver can open a dashboard or an interface that lists attempts, response codes and payload copies for the receiver own deliveries, most missing event reports resolve without a ticket, and the sender support load falls by the same measure.

Test events close the loop between documentation and reality. A sender should let a receiver trigger a sample delivery of each event type from the dashboard, signed and shaped exactly as a production delivery is signed and shaped, so that endpoint configuration, certificate health and signature verification can all be proven on a quiet afternoon rather than during a launch. Endpoint management tooling matters at the same level. Receivers change hosts, rotate secrets and retire services, and a sender that offers self service registration, secret rotation with an overlap window and a disable control that takes effect at once prevents the stale subscription problem from forming. The thread running through each of these practices is predictability offered as a feature. A receiver integrates once against behavior that holds still, and the sender that holds its behavior still becomes the integration that operations teams stop worrying about, which is the most durable competitive position a platform can occupy in an ecosystem of tired maintainers.

Designing a Receiver That Survives Its Senders

A receiver survives its senders by assuming that every delivery is hostile until verified, duplicated until proven fresh and incomplete until reconciled against an authoritative source. The order of operations inside the endpoint decides most of the outcome. Verification comes before parsing, because a parser applied to an unauthenticated body exposes the receiver to every malformed payload and hostile construction that the public internet can deliver to an open address. The signature check described in earlier sections runs against the raw request bytes, with the secret held in managed configuration, and a delivery that fails verification receives a rejection before any deserialisation, logging of payload content or business logic takes place.

Storage comes second, ahead of processing. The receiver that writes the raw payload, the headers and the delivery identifier to durable storage before attempting any interpretation owns a copy of the evidence whatever happens next. Processing can then fail, be retried from the stored copy, be replayed after a defect is repaired and be audited months later when a customer disputes a sequence of events. The receiver that processes in memory and stores only the outcome has discarded the one artefact that makes every later question answerable. Acknowledgement timing follows from the same logic. A fast 200 response issued after durable storage, with interpretation deferred to a background worker, keeps the sender retry machinery quiet and keeps slow business logic out of the delivery path, where a timeout would otherwise manufacture duplicates of an event the receiver had in fact accepted.

How can a receiver tell whether an event was already processed?

A receiver tells by checking the delivery identifier against a durable store of identifiers already recorded before any business logic runs. A match means the event entered processing once, so the duplicate receives an acknowledgement and no further work, while a missing identifier marks the delivery as new and safe to process.

Deduplication on the delivery identifier turns the at least once guarantee from a hazard into a manageable property. The store of seen identifiers needs a uniqueness constraint enforced by the database rather than by application checks alone, because two copies of the same delivery can arrive within milliseconds of each other and both pass an application level lookup performed before either write lands. Retention of the identifier store should exceed the longest retry window among the receiver senders by a wide margin, and senders such as Stripe that may retry across 3 days in live mode set the scale that the retention must cover. Idempotent handling inside the business logic adds a second layer, so that an order update applied twice converges on the same state rather than double counting a payment or double provisioning a licence.

Reconciliation on a schedule supplies the safety net beneath every other defence. A periodic job that compares receiver state against the sender authoritative records, through a list interface or a report export, finds the events that no retry ever delivered and repairs the gaps while they are still small. Silence deserves an alert of its own. A receiver that expects a heartbeat of regular events from a busy sender and receives nothing for an interval beyond the normal pattern should treat the quiet as an incident signal, because the commonest catastrophic failure in a webhook integration is not an error that announces itself. It is an endpoint decommissioned, a secret rotated on one side only, or a subscription deleted during account housekeeping, each producing a calm and total absence that no error dashboard displays. The receiver built on verification first, storage before processing, enforced deduplication, scheduled reconciliation and alerting on silence can absorb sender defects, network defects and its own defects with losses measured in delayed records rather than missing ones.

What Webhooks Cannot Do

The limits of the pattern are structural rather than incidental, and naming them plainly protects a design from being stretched across problems it was never shaped to carry. A webhook reports that an event occurred at a moment in time, and the report is the whole of the artefact. Nothing in the mechanism provides a replay of history. A receiver that subscribes on Monday holds no claim on the events of the previous year, and a receiver recovering from a week of downtime depends entirely on whatever retention and redelivery courtesy the sender chooses to offer. Systems that need a recoverable past build one deliberately, and the discipline of event sourcing exists precisely because a durable event history has to be designed and stored as a first class record rather than hoped for as a side effect of notifications that were designed to be transient.

Guaranteed ordering sits outside the pattern for the same reason. Deliveries travel as independent HTTP requests across a network that promises nothing about arrival sequence, and retry behavior actively scrambles order, since a first event delayed by a receiver error can be redelivered after its successor has already been processed. Senders may include sequence numbers or timestamps that let a receiver detect disorder, and a careful receiver can buffer, sort or re-read authoritative state before acting, but each of those remedies is receiver labor added around the pattern rather than a property the pattern supplies. Event pairs in which the second state invalidates the first, such as a refund following a payment or a cancellation following a booking, expose the gap in its sharpest form, and a receiver that applies notifications in arrival order without checking state will, given enough volume, eventually record a history that never happened.

Queryable state is absent by design. A webhook channel answers no questions. A receiver cannot ask the channel what a customer balance stands at, which events were missed during an outage or whether a given order ever reached a terminal state, because the channel carries only what the sender chose to push at the moment of change. Every such question routes back to the sender ordinary interface, which means a webhook integration is always, in practice, two integrations, the push channel for timeliness and the pull interface for truth. Designs that forget the second half discover the omission during the first serious incident, when the team reaches for a way to interrogate the past and finds a mailbox where a database was needed.

Payload shape imposes a further boundary. Notifications are sized for identifiers, summaries and changed fields, and they handle large payloads badly because every retry multiplies the transfer cost and every intermediate proxy imposes its own size ceiling. Binary data sits outside the model almost entirely. An image, a generated document or an archive belongs in object storage with the webhook carrying a reference, an address and a checksum, and senders that inline large encoded content into event payloads produce deliveries that time out, truncate and fail in ways that small payloads never encounter. Human approval workflows fall outside the scope for a different reason. A webhook is a machine speed notification between systems, and a process that waits on a person to review, approve or reject introduces delays measured in days and states that live in inboxes rather than databases. Approval belongs in an interface built for people, with the webhook, at most, announcing that a decision was recorded after the person made it. Knowing where the pattern stops is what allows a design to use it where it is strong, paired with a log where history matters, an interface where questions matter and a human surface where judgement matters.

The Pattern That Outlasts Its Implementations

Individual webhook implementations age quickly. Frameworks fall out of maintenance, signing libraries are replaced, dashboards are redesigned and whole platforms are retired, yet the underlying arrangement reappears in each new generation of tooling with its shape intact, because the arrangement answers a need that no particular stack created and no particular stack can retire. One system holds information another system needs, the second system cannot watch the first continuously, and a message sent at the moment of change closes the gap at a cost both sides can bear. That triangle of circumstances recurs wherever software is divided between owners, which is to say wherever modern software is built at all, and each recurrence rebuilds the callback in the materials of its period, from early ping services in the blogging era through the platform application programming interfaces of the 2010s to the event catalogues of large cloud vendors.

The durability has a specific source worth stating plainly. The webhook converts a problem of distributed coordination, which is hard in ways that resist general solution, into a problem of agreement between two parties, which is hard in ways that organizations already know how to manage. Ordering, recovery and final truth are not solved by the pattern. They are assigned, deliberately, to the receiver, which is the party positioned to know what its own state requires. The sender undertakes a narrower and more honorable obligation, to notify promptly, to sign honestly, to retry on a published schedule and to keep a record of its attempts that the other party may inspect. Read once more, with the emphasis placed differently, the arrangement is less a transport mechanism than a division of responsibility that happens to travel over HTTP, and divisions of responsibility survive the replacement of the machinery that carries them. Readers who keep a reading record may find the distinction a useful one to file away.

Evidence for the durability sits in the pattern behavior under stress. When a sender suffers an outage, the queued notifications and the published retry schedule carry the relationship through the gap. When a receiver fails, the delivery log and the reconciliation interface rebuild its state. When the two parties disagree about what occurred, the signed payload and the shared delivery identifier give them a common object to argue about, which is the precondition for any disagreement between organizations ending in repair rather than in blame. Each of these recoveries depends on the agreement having been specified in advance, in the schema, the signature and the retry document, and each fails in integrations where the agreement was left as folklore inside a wiki page that nobody maintained. The implementations that disappoint are rarely betrayed by their code. They are betrayed by an underspecified promise.

The structural implication reaches beyond integration design. As software continues to divide into services owned by separate teams and separate companies, the number of boundaries across which state must be signalled grows faster than the number of platforms available to absorb those boundaries into shared infrastructure. Logs and streaming platforms will hold the interior of large organizations, where one authority can mandate them. Polling will hold the quiet corners where change is slow and reads are cheap. Between organizations, across the public internet, the signed and retryable notification remains the instrument that two parties can adopt with nothing shared except an agreement and an address. Technologies are replaced when a better mechanism for the same responsibility appears. Responsibilities are replaced far more slowly, and the responsibility the webhook carries, one party answerable for announcing change and the other answerable for absorbing it, shows no sign of being reassigned.

Frequently Asked Questions

Q: What is a webhook in plain language?

A webhook is a way for one program to tell another program that something happened, without the second program having to ask again and again. The receiving program hands the sending program an address on the web, much like leaving a phone number with a shop and asking to be called when an order is ready. When the event happens, the sender places the call by itself and delivers a small message describing what occurred. The receiver then acts on that message, perhaps by updating a record, sending a confirmation, or starting a background job. The pattern removes guesswork, because information arrives at the moment it becomes true rather than whenever the receiver happens to check.

Q: How is a webhook different from an API?

An application programming interface lets one program request information or action from another, and the requesting program chooses when each request happens. A webhook reverses that direction of initiative. Instead of the receiver asking whether anything changed, the sender announces the change the moment it occurs by sending a message to an address the receiver supplied in advance. The two tools usually work together rather than competing. A team registers a webhook through an API, receives event notifications through the webhook, and then uses the API again to fetch full details or to correct a record. In short, an API answers questions on demand, while a webhook delivers news without being asked, and mature integrations rely on both halves of that conversation.

Q: Who coined the term webhook and when?

Programmer Jeff Lindsay introduced the term webhook in 2007 to describe hooks that operate across the web rather than inside a single program. Traditional software hooks let developers attach custom behavior to events inside an application, and Lindsay extended that familiar idea to services communicating over the public internet. His early writing framed webhooks as a building block for a programmable web, where ordinary users could connect services without writing large integration programs. The name stuck because it captured the mechanism precisely: a hook catches an event, and the web carries it to another system. Many later platforms adopted both the term and the pattern, and Lindsay is consistently credited in technical histories as the person who named the concept.

Q: What kinds of events can trigger a webhook?

Almost any change of state inside a service can trigger a webhook, provided the sending service chooses to expose that change. Common triggers include a payment succeeding or failing, an order being created or shipped, a file finishing an upload, a code repository receiving new commits, a support ticket changing status, and a subscription being renewed or cancelled. GitHub, for example, offers events for pushes, pull requests, releases, and issue activity, and each event type carries its own payload shape. Well designed services let subscribers choose only the event types they need, which keeps traffic low and processing simple. The governing principle is significance: an event earns a webhook when another system would reasonably want to react to it without delay.

Q: How does a sender know a webhook delivery succeeded?

A sender judges success from the response the receiving server returns to the delivery request. Receiving servers answer with standard status codes, and codes in the 200 range tell the sender that the message arrived and was accepted. Stripe and GitHub both treat a 2xx response as a successful delivery and record the attempt, the response code, and the response body in a delivery log that operators can inspect. A response in the 400 or 500 range, or no response at all before a timeout expires, marks the attempt as failed and starts the retry schedule. Because the acknowledgment only confirms acceptance, careful receivers respond after storing the event safely, so a success signal never claims more than the receiver can guarantee.

Q: What is a webhook endpoint?

A webhook endpoint is the specific web address a receiving system publishes so that senders know where to deliver event messages. It is an ordinary URL, usually served over encrypted connections, backed by a small handler whose only job is to accept incoming requests on that path. Each endpoint typically maps to one purpose, such as processing payments or syncing orders, which keeps validation rules and business logic separate and easier to test. Providers such as GitHub let account owners register several endpoints on one account, each subscribed to different events. A good endpoint stays stable, answers quickly, verifies every message, and records enough detail for operators to trace a delivery from arrival through final handling without guesswork.

Q: How long do senders keep retrying a failed webhook?

Retry windows vary by provider, because each platform balances the receiver’s chance to recover against the cost of holding undelivered messages. Stripe retries failed deliveries for up to three days in live mode, using an expanding schedule that waits longer between each attempt. GitHub takes a different approach and does not retry automatically in the same way, instead letting owners redeliver events manually from the delivery log. Other providers fall between those poles, retrying for hours or for a few days with exponential backoff and random jitter to avoid hammering a struggling server. Receivers should therefore never assume a fixed window. Sound design treats retries as a safety net, stores events durably on arrival, and gives operators a manual redelivery path for anything the schedule misses.

Q: What is a dead letter queue in webhook delivery?

A dead letter queue is a holding area for messages that could not be delivered or processed after every retry was exhausted. Instead of discarding a failed event, the system sets it aside with its payload, its delivery history, and the error that ended the attempts. Operators can then inspect the queue, diagnose the cause, fix the underlying fault, and replay the stored messages in order once the receiver is healthy again. The pattern comes from message queue systems, where poison messages that always fail would otherwise block healthy traffic behind them. For webhooks, a dead letter queue protects both sides: senders stop wasting attempts on a broken destination, and receivers gain a complete, auditable record of everything that still needs attention.

Q: What format does a webhook payload use?

Most webhook payloads use JSON, the text format built from objects, arrays, strings, numbers, and booleans that nearly every programming language reads natively. A typical payload names the event type, carries a unique identifier for the event, records when the event occurred, and nests the affected object, such as an order or a payment, with the fields a receiver needs to act. Some older services, including PayPal in its classic instant payment notification system, send form encoded fields instead, and a small number of senders offer XML for compatibility with enterprise systems. Whatever the format, the contract matters more than the syntax: field names, types, and versioning rules must stay stable, because receivers build strict parsers on top of them.

Q: Is polling or webhooks cheaper to run?

Webhooks are usually cheaper at scale because traffic flows only when something actually changes, while polling spends requests on a fixed schedule whether or not anything happened. A receiver polling every minute makes 1,440 requests a day per watched resource, and most of those responses report no change at all. Each wasted request still costs bandwidth, compute, and rate limit allowance on both sides. Polling keeps one advantage: it is simple, it recovers naturally from missed events, and it works when a receiver cannot accept incoming connections. For that reason many teams combine both methods, using webhooks for prompt delivery and a slow reconciliation poll to catch gaps. The honest comparison depends on event frequency, and very chatty resources can occasionally make polling the calmer option.

Q: What is HMAC signature verification for webhooks?

HMAC signature verification lets a receiver confirm that a webhook message genuinely came from the claimed sender and was not altered in transit. The sender and receiver share a secret key. Before sending, the sender runs the payload through a keyed hash function, commonly HMAC with SHA-256, and places the resulting signature in a request header. The receiver repeats the computation on the exact bytes it received and compares the two values using a comparison that resists timing attacks. Stripe documents this scheme for its signing secrets, and GitHub recommends the same practice for its webhook deliveries. A mismatch means the message is forged, corrupted, or signed with the wrong secret, and the receiver rejects it without processing anything.

Q: What happens to webhooks when the receiver is offline?

When a receiver is offline, delivery attempts fail with connection errors or timeouts, and the sender records each failure and moves the event into its retry schedule. Nothing is lost immediately, because responsible senders store the event and keep trying with longer waits between attempts for hours or days. If the receiver returns within the retry window, a later attempt succeeds and processing continues, though events may arrive out of order and receivers must sort by event time rather than arrival time. If the outage outlasts the window, undelivered events land in a dead letter queue or remain visible in the provider delivery log for manual redelivery. Receivers that reconcile against the sender API after an outage close any remaining gaps completely and safely.

Q: Can one event be sent to many webhook endpoints?

Yes, a single event can be delivered to many endpoints, and fan out of this kind is a normal part of webhook design. A store platform might send one order event to an accounting system, a warehouse system, a messaging tool, and an analytics pipeline, each at its own address and each processing the event independently. The sender tracks every destination separately, so one failing endpoint never blocks or cancels deliveries to the others, and retries apply only where they are needed. GitHub supports this pattern by allowing multiple webhooks on one repository, each with its own event subscriptions. Subscribers benefit because each team owns its own endpoint, sets its own filters, and can pause or repair its integration without coordinating with anyone else.

Q: How do webhook inspection tools help debugging?

Webhook inspection tools give developers a temporary public address that captures incoming requests and displays exactly what arrived. The developer registers that address with a provider, triggers a real event, and then examines the recorded request, including its headers, its body, its content type, and the precise time it landed. This removes guesswork during development, because the payload on screen is the payload the provider actually sent rather than the payload the documentation led the developer to expect. Inspection tools also help verify signature headers, test how a sender behaves on retries, and share a captured request with a teammate when something looks wrong. Once the shape of the traffic is understood, the developer points the subscription at the real application endpoint with confidence.

Q: What is the difference between webhooks and WebSockets?

Webhooks and WebSockets both move information promptly, but they differ in connection style, direction, and typical use. A webhook is a single short request between servers: the sender opens a connection, delivers one event, reads the response, and closes the exchange. A WebSocket is a long lived connection, usually between a browser or an application and a server, that stays open so both sides can send messages at any moment with very low delay. The W3C and the standards community position WebSockets for interactive sessions such as chat, games, and live dashboards. Webhooks suit server to server notifications where no session exists and each event stands alone. Choosing between them is mostly a question of whether the conversation is continuous or occasional.

Q: How do online stores use webhooks for orders?

Online stores use webhooks to keep every connected system synchronized as an order moves through its life. When a customer pays, a payment event can trigger confirmation messages, accounting entries, and fraud checks. When warehouse staff mark the order as shipped, a fulfillment event can update the storefront, notify the customer with tracking details, and adjust inventory counts in an external system. Refund and cancellation events flow the same way, reversing earlier steps in the right order. Platforms such as Shopify expose order, checkout, and fulfillment events so that outside tools react without scraping pages or polling the store database. The result is a store whose parts agree with each other within seconds, even though separate companies operate many of those parts.

Q: What is an idempotency key?

An idempotency key is a unique value attached to a request or an event so that repeating the same operation cannot produce the effect twice. The receiver stores the key alongside the result of the first processing attempt. When a duplicate arrives carrying the same key, the receiver recognizes it, skips the work, and returns the original outcome instead of charging a card again, shipping a second parcel, or crediting an account twice. Stripe popularized the pattern for safe API retries by letting clients supply keys with payment requests. In webhook handling the event identifier plays the same role, because senders retry deliveries and networks duplicate messages. A receiver that records processed identifiers gains a simple, durable defense against double effects of every kind.

Q: How are webhook signing secrets rotated?

Secret rotation replaces an old signing key with a new one without breaking deliveries during the changeover. The safest method overlaps the two secrets for a limited window. The provider begins signing with the new secret, or signs with both, while the receiver accepts signatures from either key and operators confirm that verification still passes on live traffic. Stripe supports rolling a signing secret with an overlap period of up to 24 hours, after which the old secret stops working entirely. Once every receiver verifies against the new secret, the old one is revoked and removed from configuration. Teams schedule rotation on a regular cadence and also rotate immediately after any suspected leak, treating the secret with the same care as a password.

Q: What is CloudEvents and why does it exist?

CloudEvents is a specification from the Cloud Native Computing Foundation that gives event messages a common envelope, whatever produced them and whatever carries them. Before CloudEvents, every platform invented its own payload layout, so a receiver needed custom parsing code for each sender and events lost context when they crossed systems. The specification defines standard attributes such as an event identifier, a source, a type, and a time, while the event data itself rides inside the envelope in any format the producer chooses. Bindings describe how the envelope travels over HTTP and other transports. The practical effect is interoperability: routing tools, brokers, and serverless platforms can inspect, filter, and forward events from many producers using one shared vocabulary instead of dozens of private ones.

Q: How does a team monitor webhook delivery health?

A team monitors webhook health by measuring deliveries the way it measures any production traffic. Useful signals include the success rate of delivery attempts, the time between an event occurring and its acceptance, the size of the retry backlog, and the number of messages sitting in the dead letter queue. Dashboards built from provider delivery logs show which endpoints fail, which event types error most, and whether failures cluster after a deployment. Alerts fire when the failure rate crosses a threshold the team sets in advance, so an outage pages an operator before customers notice stale data. Regular reconciliation against the sender records then proves completeness, catching the quiet losses that rate based alerts can miss entirely over long periods of time.