How it works
You give the service a URL and tell it which events you want. When one happens, the service sends an HTTP POST with the details, usually JSON. Your server reads it, does the work and answers 200. That is all a webhook is: an ordinary web endpoint that you did not call yourself.
@app.post("/hook")
def hook():
if request.headers.get("X-Secret") != os.environ["HOOK_SECRET"]:
abort(401) # not from the service
event = request.get_json()
queue.put(event) # do the slow work later
return "", 200 # answer fast
$ curl -X POST https://you.example/hook -H "X-Secret: s3cret" -d '{"event":"paid"}'
HTTP/2 200
Three rules for a good receiver
| Rule | Why | How |
|---|---|---|
| Check the sender | Anyone can POST to a public address | A shared secret in a header, or a signature. Telegram adds X-Telegram-Bot-Api-Secret-Token when you set a secret |
| Answer fast | Senders give up on slow replies | Save the event, reply 200, work in the background |
| Expect repeats | Telegram repeats a webhook request that fails, and gives up after a reasonable number of attempts | Store the event id and skip ones you have seen |
The address must be public and, for most services, https. Telegram accepts ports 443, 80, 88 and 8443 and TLS 1.2 and up. On a laptop, a tunnel can expose it for tests; for real use the receiver lives on a server.
Do you need one?
Use a webhook when
- The service offers it. Payments, Git pushes, chat messages and form answers all do.
- Events are rare or bursty. You do not want a loop that asks all day.
- A sleeping server is fine. Nothing needs to run between events.
Poll instead when
- You have no public address. A script on a home laptop cannot be called.
- The service has no webhooks. You ask on a timer.
- You must catch up in bulk. Asking for a list is simpler than replaying calls.
Webhooks in Uno
The rule for bots: a bot on a webhook wakes the computer with each message; a bot on long polling cannot, so switch it to a webhook. Address: a computer that serves HTTP on port 80 gets a real https address with a valid certificate; Uno handles the encryption, and you buy no domain. A form on a site you publish can send its answers to your email, Telegram, or a webhook.
Small: $5 a month
What to know about sleep
- Polling bots: a bot on long polling only makes outgoing requests, and an outgoing request does not wake a sleeping computer. Switch such a bot to a webhook.
- The wake rule is confirmed for Telegram messages sent to your computer's webhook address. For other senders, test one event before you rely on it, and prefer senders that repeat a failed call.
Receive webhooks from $5 a month
A real Linux computer with an https address. It sleeps when nothing happens and wakes when a call arrives.
Small
A Telegram bot, a VPN, a small backend
$5/ month
- 1 vCPU · 1 GB
- 15 GB disk
- 25 GB cloud storage
- 5 boosts a month
Plus
Agents that work with your laptop closed
$20/ month
- 4 vCPU · 4 GB
- 40 GB disk
- 100 GB cloud storage
- Uno Work in the cloud
Pro
A product in production, a second MacBook
$70/ month
- 16 vCPU · 16 GB
- 120 GB disk
- 300 GB cloud storage
- Speed of a MacBook Air M4
Max
A team and many agents at once
$200/ month
- 32 vCPU · 48 GB
- 300 GB disk
- 1,024 GB cloud storage
- 5 public IPv4
Add Uno AI to any plan: 40 h of AI work a month on Small, 100 h on Plus, unlimited on Max. Today: GLM-5.3 Flash and MiMo v2.6 Pro. Or sign in with your own Claude or ChatGPT.
Questions
Is a webhook the same as an API?
Where do I find my webhook address?
https://you.example/hook. You then paste it into the service's settings.