webhook
/ WEB-hook /
A webhook is a reverse API: instead of you repeatedly asking a service 'anything new yet? anything new yet?', the service calls you the moment something happens. You hand it a URL of yours up front, and it promises to send a little message there whenever the event you care about occurs.
Picture the difference between standing at the mailbox opening it every five minutes versus just having the mail carrier ring your doorbell when a letter arrives. The first way (you asking over and over) is called polling, and it's wasteful — most of the time the answer is 'nope, nothing.' A webhook is the doorbell: the service does the calling, only when there's actually news, so you find out instantly and your code can sleep the rest of the time.
You see them everywhere once you know the shape. Stripe pings your URL when a payment succeeds; GitHub pings it when someone pushes code; a chat app pings it on every new message. You write a small endpoint that sits and waits, and the outside world knocks on it when it has something to tell you.
POST /my-webhook HTTP/1.1
Content-Type: application/json
{ "event": "payment.succeeded", "amount": 4200 }The service POSTs to your URL the instant the event fires — no polling needed.
Normal API: you call them. Webhook: they call you. Same HTTP, opposite direction.