Skip to main content
Boletolibre

Webhooks for websites: an event delivery checklist

A webhook lets one service notify another when an event occurs. For a website, that might mean a content system telling a receiving endpoint that a page was published. The useful question is not merely “Do we have a webhook?” but “Which event, from which account, should cause which website action, and how will we know it worked?”

Boletolibre editorial team

Published

A provider event travels through a verified delivery into a website receiver and durable work queue; a curved path marks retries.
Map delivery, verification, durable acceptance and the later website action as separate steps.

Map the event before choosing the endpoint

Download the editable webhook delivery handoff worksheet (Markdown)

A webhook is a provider-initiated HTTP request, often a POST, sent when a chosen event happens. It can replace repeated status checks for that event, but it is not a promise of instant delivery or completed work. Provider contracts differ: Twilio documents some GET webhooks and flows that require a response body. Read the exact product and event documentation before making a universal rule.[4][1]

Start with a hypothetical content workflow: a CMS publishes an article, then your website refreshes that article. Record the source account and environment, the exact event name, the receiving URL owner, and the expected visible change. If the website can instead check status at a suitable interval, polling may be simpler. Choose based on acceptable delay, provider support and the cost of missed updates.[1][2]

Work through one invented publication: the source CMS emits article.published for object X in production. The receiver verifies that the event belongs to the expected account and environment, records the delivery ID, and queues a refresh of URL Y. The worker then fetches the current article state and updates the site. The visible page, not the provider’s delivery badge, is the final evidence. “Article saved as draft” and “article unpublished” need separate rules or an explicit decision to do nothing; similar-sounding events must not silently reuse the publish action.[1][2]

Write the delay and consequence beside the rule. A ten-minute editorial refresh may be fine with periodic API checks; a ticket-availability change may need a shorter detection path and an operator fallback. A webhook can reduce needless polling, but delivery can be delayed, rejected or accepted before downstream work fails. Estimate the acceptable gap in the website’s own terms, then decide who notices and repairs a missing update. This is a requirement for the integration, not a claim that any provider meets a universal delivery time.[1][2]

Write down the provider contract

Record the method, content type, payload version, event identifier, authorization method, timeout, accepted response, retry schedule and manual replay path from the provider’s documentation. Subscribe only to events that have an owner and a defined action. An “everything” subscription creates traffic without making the website more reliable.[1][2]

Treat the payload as a notification, not necessarily a complete or current snapshot. Decide whether the receiver should fetch the latest object from the provider before changing the website. For each event, write a sentence such as “When article X is published in production, queue refresh of URL Y.” Keep staging and production endpoints, secrets and test evidence separate.[4][1]

Make the contract specific enough for two teams to test independently. Record the exact subscribed event and action, account, endpoint URL, method, content type, payload version, identifier fields, signing method and the success response the provider accepts. Add its response deadline, automatic retry conditions, delivery-history retention and manual redelivery route. A provider may send several event types to one URL, but the receiver still needs an explicit action for each accepted type. Leave an unknown value marked unknown and assign an owner to find it before launch.[1][2]

Version and ownership changes belong in that same record. A provider may add optional fields or change the shape of a new event version, so parsing should ignore unrelated additions and reject or quarantine payloads it cannot safely interpret. Keep test and production registrations separate. If the endpoint URL, account, subscription or signing secret changes, name the person who updates both provider configuration and receiver verification, and the person who reruns the end-to-end test. A successful test delivery to the old endpoint says nothing about the new one.[1][2]

Verify the sender and protect the endpoint

Use HTTPS and the provider’s supported authentication or signature check. Stripe verification uses the unmodified request body, its signature header and an endpoint secret; Twilio’s validation depends on the exact request URL and parameters or raw JSON body. These are examples of different contracts, not interchangeable recipes.[1][3][2]

Store the secret in a managed secret store, restrict who can rotate it, and never put it in a worksheet, URL, log or screenshot. Reject invalid requests before accepting work. Allow only documented event types and map each to the minimum action needed. Record the secret owner and rotation procedure, not the secret value.[3][2]

Treat signature verification as a byte-and-route contract. For Stripe, preserve the raw request body and use its endpoint secret and Stripe-Signature header. For Twilio, validate against the exact URL and the documented parameters or original JSON body; decoding or re-encoding the URL can change the material being checked. A proxy, framework parser or redirect can alter what the application sees, so test the real production path with a provider-generated sample. Do not copy a Stripe verifier into a Twilio receiver or infer authenticity from an HTTPS connection alone.[1][3]

A valid signature establishes that a request matches the provider’s validation scheme; it does not authorize every action in the payload. Check the expected provider account, environment, event type, action and object scope before queuing site work. Define what happens to an authentic but unsupported type: record minimal diagnostic metadata, avoid changing the site, and choose the provider-specific response deliberately. Restrict the worker’s credentials to the website action it needs. When debugging, log an event ID and validation outcome rather than raw payloads, URL secrets or signing material.[3][2]

Acknowledge delivery only after durable acceptance

Separate “the endpoint received this request” from “the website finished updating.” Verify authenticity and persist the event or enqueue a durable job before returning the provider’s success response. Then do slower API reads, rendering or publishing work asynchronously. Check the provider’s required response and deadline; GitHub and Stripe both advise prompt success responses. Durable acceptance is the receiver’s safeguard against losing work.[1][2]

A success response can stop retries even if later work fails, so monitor the queued job and its final outcome. Reject an invalid authenticity check without queuing work. If a verified request cannot be durably recorded, return the provider-documented failure response and investigate its retry or replay path. The exact status code, response body and retry behavior depend on the provider.[1][2]

Use four acceptance cases in the runbook. A valid, supported and verified event that is durably recorded may receive the provider’s success response, even though the visible website work is pending. An invalid signature must not be queued. A verified event that cannot be stored or queued has not been accepted; return the provider-documented failure response rather than a premature success. A duplicate already recorded may be acknowledged without creating a second task, but only after the receiver can identify it reliably. Record the expected status and body for each case in the worksheet.[1][2]

This boundary matters during outages. Suppose the receiver verifies an event, starts a refresh, times out and replies with an error: the provider may deliver it again while the first refresh still runs. Suppose instead it replies with success before saving anything and crashes: the provider may consider the delivery complete while the site never changes. Persist the verified event before success and make the worker safe to repeat to handle a timeout and retry. If success preceded storage, that request has no durable record and may receive no retry; look for it through provider-supported replay or reconciliation against the source. Test this gap explicitly. Keep acceptance, work completion and visitor-visible confirmation as three separate timestamps.[1][2]

Plan for duplicates, delays and missing events

Assume a delivery can be repeated, delayed or arrive out of order. Stripe explicitly warns about duplicate events and ordering; GitHub provides redelivery guidance for missed deliveries. Track the provider event or delivery ID to recognize repeated delivery. Make the website action safe to repeat for the same object and state without suppressing a later legitimate update; fetch current source state or compare a documented version before changing the site.[1][2]

Write down the provider’s automatic retry window, manual replay steps and a reconciliation method, such as a scheduled comparison against the source API. Do not equate “retry scheduled” with “event eventually processed.” Keep enough metadata to trace a delivery, while limiting sensitive payload retention. Set an owner and alert for events that remain unprocessed.[1][2]

Document retry behavior from the actual provider, not from the word “webhook.” Stripe currently documents automatic delivery attempts for up to three days in live mode and a separate manual resend path; a manual resend does not by itself cancel scheduled automatic attempts. GitHub documents timely 2xx replies within ten seconds and a path to redeliver missed deliveries. These are provider examples, not rules for every service. In the handoff, capture the retry window, which responses trigger it, where failures appear, who may replay, and when a reconciliation job must fill a gap after that window.[1][2]

Delivery order is a second uncertainty. A publish event can arrive after a later unpublish event, or a retry can follow a newer update. Stripe explicitly says its events are not guaranteed in generation order. Do not decide current site state from arrival order or one timestamp alone. For the fictional CMS, use the stable article ID to ask the source for its current publication state before applying a stale notification, or use a provider-documented version rule. Preserve enough event and job identifiers to explain why a change was skipped. This is about website state, not the separate email-send ledger.[1][2]

Run a handoff test that proves the outcome

In a test environment, send a valid event and confirm both the provider delivery record and the final website change. Then try an invalid signature, a duplicate delivery, delayed or reversed events, a temporary receiver outage and recovery. Note the expected HTTP response, queued record, retry or replay behavior, and final state for each case.[1][2]

Give the next maintainer a small runbook: event names, endpoint and source owners, environment, secret rotation location, monitoring link, retry and reconciliation rules, last successful test, and a way to disable the subscription during retirement. The downloadable worksheet turns those choices into a reviewable handoff rather than an undocumented endpoint.[1][2]

A worked handoff can be one row with a trace: source account A emits article.published for X at 14:05; delivery D reaches the production URL; verification passes; durable job J is written; the receiver returns the documented success response; worker J refreshes URL Y; a reviewer opens Y and sees the new article at 14:06. In real records, replace the fictional IDs and times with safe identifiers and measured observations. If the visible page remains old, the case is “accepted but not completed,” even when D is green in the provider dashboard.[1][2]

Test the negative paths as intentionally as the happy path. Simulate an invalid signature, an unsupported event, unavailable durable storage, duplicate delivery, a receiver timeout, reversed event order and a worker failure after success acknowledgment. For each, compare provider delivery history, receiver validation record, queue/job state and the public page. Assign one owner to correct the receiver and another to approve content or site changes; define who can ask the provider to redeliver and who can disable the subscription. Retest after changing URL, secret, event version or worker behavior, then date the runbook.[1][2]

Sources and further reading

  1. Receive Stripe events in your webhook endpointStripe · Accessed
  2. Best practices for using webhooksGitHub Docs · Accessed
  3. Webhooks securityTwilio Docs · Accessed
  4. Webhooks FAQTwilio Docs · Accessed