October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

What Is a Webhook, and How Do You Set One Up Safely?

A webhook sends an HTTP event notification to your endpoint. Learn how to configure, authenticate, test, and process deliveries safely.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A webhook is an HTTP request a service sends to your application when a specified event happens. To use one safely, register a reachable HTTPS endpoint, subscribe only to events you need, verify each request using the provider’s signing rules, and acknowledge quickly before processing work in the background. Exact headers, payloads, retry behavior, and deadlines vary by provider.

How a webhook works

A webhook is an event callback. Instead of your application repeatedly asking a service whether anything has changed, the service sends an HTTP request to a URL you register when a subscribed event occurs. Your endpoint receives the request, authenticates it, checks the event type and action, and then handles the work.

As an Amazon Associate I earn from qualifying purchases.

A webhook is an integration pattern, not a universal protocol with one standard security or delivery contract. For example, providers can differ in signature header names, how they encode signatures, which request bytes they sign, how long they wait for a response, and whether or how they retry. Follow the sending provider’s current documentation for those details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to set up a webhook endpoint

  1. Choose the events you need. Subscribe only to events your application uses. GitHub recommends limiting subscriptions to reduce unnecessary work: GitHub’s webhook best practices.
  2. Make the endpoint reachable over HTTPS. Configure a publicly reachable URL with a valid TLS certificate, and leave certificate verification enabled. DNS resolution, network restrictions, TLS problems, timeouts, or invalid HTTP responses can prevent delivery.
  3. Configure a provider-specific secret. Use a strong secret when the provider supports signatures. Store it in a secrets manager or protected environment configuration rather than source code or a repository. Do not put API keys or credentials in the webhook URL.
  4. Verify the request before trusting it. Implement the provider’s signature check before acting on the body or metadata. Preserve the raw request bytes if the provider signs the raw body. Shopify specifically says to run verification middleware before body-parsing middleware: Shopify’s HTTPS webhook guidance.
  5. Dispatch only recognized events. After verification, inspect the event type and any action field, then route the event to the appropriate handler. GitHub notes event types and actions can evolve, so avoid assuming that every payload will match an old fixed list of fields.
  6. Respond promptly and move slow work off the request. GitHub recommends returning a 2XX response within 10 seconds. If handling the event could take longer, validate it, place it on a queue, and acknowledge the request rather than holding the connection open during business processing.
  7. Make processing safe to repeat. Record delivery identifiers where available and make handlers idempotent: processing the same event again should not accidentally repeat a one-time action. Retries can create duplicate deliveries, and events may arrive out of order.

How to test deliveries and diagnose failures

Trigger a real event or a provider-supplied test event, then inspect the provider’s delivery history and the response your endpoint returned. If no delivery appears, check the event subscription and trace whether the provider attempted delivery. GitHub’s troubleshooting guide covers common delivery failures: GitHub webhook troubleshooting.

Connection or delivery failures

  • Confirm the registered URL resolves in DNS and is reachable from outside your network.
  • Check firewall rules, hosting network restrictions, and any proxy or load balancer in the request path.
  • Confirm the TLS certificate is valid and the endpoint returns a valid HTTP response.
  • Look for slow handlers or timeouts. Acknowledge promptly and move lengthy work to a background queue.

Signature verification failures

  • Confirm that a secret is configured for this endpoint and that your application uses the matching secret.
  • Check the exact signature header, algorithm, encoding, and signed bytes specified by the provider.
  • Ensure middleware, proxies, or other request handling have not changed the body or signature header before verification.
  • For a provider that signs raw request bytes, verify the untouched body before any JSON or form parsing. Shopify documents this middleware ordering for HTTPS webhooks.

GitHub provides a test vector for checking an HMAC-SHA256 implementation: secret It's a Secret to Everybody, payload Hello, World!, expected digest 757107ea0eb2509fc211221cce984b8a37570b6d7586c22c46f4379c8b043e17. It checks the GitHub-style calculation only; it does not replace a test using your configured secret and an actual provider event. See GitHub’s delivery validation documentation.

Provider-specific timing can also matter. Shopify’s API documentation says the shop/redact event can be emitted after a delay following uninstall; do not treat that behavior as a general webhook delivery rule: Shopify webhook API documentation.

Security checks before going live

  • Require HTTPS and validate certificates. GitHub recommends keeping SSL verification enabled. If you use an IP allowlist, refresh it periodically because delivery IP addresses can change; GitHub’s metadata endpoint provides the current list. Allowlisting is an additional network control, not a substitute for signature verification. See GitHub’s best practices.
  • Authenticate before acting. For GitHub, compute the HMAC using the configured secret and compare it with X-Hub-Signature-256 using a constant-time comparison, not ordinary string equality. Shopify HTTPS webhooks instead use a base64-encoded HMAC in X-Shopify-Hmac-SHA256, based on the app client secret and raw request body. These formats are provider-specific.
  • Do not trust metadata before verification. Shopify warns that headers such as the topic and shop domain are untrusted until the signature verifies. Treat event fields and routing metadata the same way: authenticate the request before using them to make decisions.
  • Protect and scope secrets. Use a high-entropy value, keep it out of code and URLs, and separate configuration by environment where your provider supports it. Limit subscriptions to necessary events and keep work at the network request boundary bounded.
  • Plan for retries and ordering. Track delivery IDs where available, deduplicate repeated deliveries, and avoid relying on event arrival order to reconstruct state. Provider delivery logs and manual redelivery can help recover from failures, but their availability and behavior depend on the provider.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to check in a provider’s webhook documentation

Before integrating a new provider, confirm these details rather than assuming they match another service:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Which header carries the signature, its encoding and algorithm, and exactly which bytes are signed.
  • How secrets are created, stored, rotated, and separated between environments.
  • The response deadline, retry schedule, and conditions that trigger redelivery.
  • Whether deliveries have unique identifiers, how duplicates are handled, and what ordering or delay guarantees exist.
  • Where to inspect delivery logs and whether failed requests can be manually redelivered.
  • How to send test events and whether development-mode events have special timing.

GitHub and Shopify illustrate why these are provider-specific questions: their signature headers and representations differ, and their documentation describes distinct delivery and timing behaviors.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.