dev-tools
Glossary ↗Webhook
A webhook is a way for one system to notify another system in real time, the moment something happens, by sending an HTTP POST request to a URL the receiving system has registered in advance — the inverse of typical API usage, where a client repeatedly polls a server asking "has anything changed yet?" With webhooks, the server pushes a notification only when there's actually something to report, which is far more efficient than polling and delivers near-instant notification instead of the delay inherent in a polling interval. Nearly every major API-driven platform supports webhooks: Stripe fires a webhook when a payment succeeds, GitHub fires one when a pull request is opened, and Anthropic-adjacent SaaS tooling commonly uses webhooks to notify a downstream system when a long-running AI job (like a batch processing job) completes. Why it matters for AI/SaaS builders: webhooks are the standard integration pattern for connecting independent systems in real time without either side needing to constantly poll the other — they're the backbone of automation platforms like Zapier and Make.com, and they're essential for anything event-driven, like updating a CRM the instant a Stripe payment fails, or kicking off downstream processing the moment a user completes onboarding. Because webhook endpoints are public URLs that accept arbitrary POST requests, correctly verifying the request's authenticity (typically via a signature check using a shared secret) is critical — an unverified webhook endpoint is a real security risk, since anyone who discovers the URL could send fake events. How it works: the receiving application registers a URL with the sending platform (often via a dashboard or API call) and specifies which events it wants to be notified about. When that event occurs, the sending platform sends an HTTP POST to the registered URL with a JSON payload describing the event; the receiving endpoint must respond quickly (typically within a few seconds) with a 2xx status code to acknowledge receipt, or the sender will retry with backoff, assuming delivery failed. Worked example: a SaaS company wants to grant a user access to a paid feature the instant they complete a Stripe checkout. They register a webhook endpoint `POST /webhooks/stripe` with Stripe, subscribed to the `checkout.session.completed` event. When a customer pays, Stripe sends a POST request to that URL with a JSON payload like `{"type": "checkout.session.completed", "data": {"object": {"customer_email": "user@example.com", "amount_total": 4900}}}`. The endpoint verifies the request's Stripe signature header against their webhook secret to confirm it's genuinely from Stripe (not a spoofed request), then updates that user's account to `plan: "pro"` in their database and returns a `200 OK` — all happening within roughly a second of the actual payment, with zero polling required.
Related terms