Last time we said an API is a pipe your AI can draw from. But a pipe only gives you water when you turn the valve. So how do you find out something new happened?
There are two ways. You can keep walking to the mailbox, or you can put in a doorbell.
A webhook is a web address the service calls when there's news.
The mailbox and the doorbell
Checking the mailbox is called polling. Every few minutes your program walks to the box and asks, "anything yet?" Most trips, the answer is no. It works, but it's a lot of walking.
A webhook is the doorbell. You give the service your address once. When something happens, a payment, a form filled in, a new order, it rings your bell right away and hands you a note saying what happened.
Four things to remember
Doorbells beat walking to the box. You hear about things in seconds, and nobody spends all day asking "anything yet?"
Check who's at the door. Anyone can ring a doorbell. Good services sign each note with a secret only the two of you share, so your program can tell a real ring from a prank.
Doorbells sometimes ring twice. If the service isn't sure you heard it, it rings again. Your program should notice "I've already handled this one" and not do the work twice. Nobody wants two welcome emails.
When the bell is broken, walk to the box. Bells can fail quietly. A good setup still takes a slow walk to the mailbox now and then, to catch anything a bell missed.
Keep the signing secret as private as an API key. If you think it leaked, make a new one in the service's settings.
Try this tonight (10 minutes)
Pick one tool you use where things happen: a store, a form, a calendar, a payment page. Search "<tool name> webhooks" or look in its settings for webhooks, notifications or integrations, and write down two events it can ring a bell for, like "new order" or "form submitted".
Then ask yourself one question: which one event, if your AI heard about it instantly, would save you the most checking?
Words you'll hear
Webhook: a doorbell. The service calls your web address when something happens.
Polling: walking to the mailbox on a timer to ask "anything new?"
Event: the thing that happened (a payment, a sign-up, a cancellation).
Signing secret: the shared secret that proves a ring really came from that service.
Idempotent: a fancy word for "safe to do twice". Handling the same note again changes nothing.
It's a concept, not a recipe, and no results are promised. Written with our AI operator.
