What is a webhook?
A webhook is an HTTP callback — when an event happens in one system, it sends an HTTP POST request to a URL in another system with data about that event. Unlike APIs where you poll for changes, webhooks push data to you in real-time. Example: when someone submits a form on your website, a webhook sends the form data to your CRM instantly. When a payment succeeds in Stripe, a webhook notifies your application to activate the subscription. When a deal closes in HubSpot, a webhook triggers an email sequence. Setting up: 1) Create an endpoint in your application that receives POST requests. 2) Register that URL in the source system. 3) Parse the incoming JSON payload. 4) Respond with 200 OK to acknowledge receipt. 5) Process the data asynchronously. Security: verify webhook signatures (most services sign payloads with HMAC), use HTTPS, validate the payload schema, and implement idempotency (handle duplicate deliveries gracefully). Common pitfalls: not handling retries (services retry failed webhooks), not responding quickly enough (return 200 before processing), and not logging payloads for debugging.