A webhook is an automated message sent from one application to another when a specific event occurs. Instead of your app constantly checking 'did anything happen?', the external service pushes a notification to your app the moment something does. Webhooks power real-time integrations between services.
Webhooks are how services communicate events in real time. If APIs are like making a phone call, webhooks are like receiving a text notification.
| Polling (without webhooks) | Webhooks |
|---|---|
| "Did anything happen yet?" every 5 seconds | "Something happened!" when it happens |
| Wastes resources on empty checks | Only fires when there's an event |
| Delayed awareness | Instant notification |
| Simple to implement | Requires an endpoint |
| Service | Event | Your App Does |
|---|---|---|
| Stripe | Payment completed | Activate subscription |
| GitHub | Code pushed | Trigger deployment |
| Resend | Email bounced | Update user record |
| Clerk | User created | Set up user profile |
Always verify webhook signatures: