TutorialMy work
How to wire Beds24 to Telegram
Free booking alerts on your phone. Your bot, your server, no subscription. Step-by-step.
Instead of refreshing the Beds24 panel, let it message you. Below is the simplest fully free version: Beds24 hook → small script on your server → Telegram bot. Cost: 0 / month (assuming you already have a VPS).
What you get
- Instant phone message on events you choose (new booking, cancellation, modification)
- Full control over copy, recipients, and event types
- No middlemen
What you need
- Beds24 account with webhook settings
- A Telegram bot (two minutes with BotFather)
- An HTTPS URL on a server you control (Caddy makes certificates easy)
1. Create the bot
- Open Telegram → @BotFather →
/newbot - Pick a name and username
- Save the token — treat it like a password
2. Get your chat_id
- Message your new bot anything
- Open
https://api.telegram.org/bot<TOKEN>/getUpdates - Find
"chat":{"id":123456789}— that’s yourchat_id
3. Webhook in Beds24
Settings → Hooks and add:
- Events — start with one (
Booking created) - URL — e.g.
https://your-server.example/hook/beds24 - Optional shared secret header
4. The endpoint
pip install fastapi uvicorn httpx
webhook.py:
import os
import httpx
from fastapi import FastAPI, Request, HTTPException
app = FastAPI()
TOKEN = os.environ["TG_BOT_TOKEN"]
CHAT_ID = os.environ["TG_CHAT_ID"]
SECRET = os.environ.get("HOOK_SECRET")
@app.post("/hook/beds24")
async def beds24_hook(request: Request):
if SECRET and request.headers.get("x-hook-secret") != SECRET:
raise HTTPException(status_code=403)
data = await request.json()
event = data.get("hook_name") or data.get("event") or "event"
fields = data.get("data") or data
lines = [f"Beds24: {event}"]
if isinstance(fields, dict):
lines += [f"{k}: {v}" for k, v in list(fields.items())[:8]]
text = "\n".join(lines)
async with httpx.AsyncClient(timeout=10) as client:
await client.post(
f"https://api.telegram.org/bot{TOKEN}/sendMessage",
json={"chat_id": CHAT_ID, "text": text},
)
return {"ok": True}
Run it:
TG_BOT_TOKEN="..." TG_CHAT_ID="123456789" HOOK_SECRET="..." \
uvicorn webhook:app --host 0.0.0.0 --port 8000
Tip: log the raw payload on the first few events — Beds24 field shapes vary. Shape the message after you’ve seen real data.
5. HTTPS and autostart
# Caddyfile
your-server.example {
reverse_proxy localhost:8000
}
- Prefer an unguessable path (
/hook/x8k2m9) - Verify a secret header if Beds24 allows it
systemdorpm2for restart on reboot
Test
- Trigger a test hook in Beds24 (or wait for a real event)
- Check reverse-proxy and app logs for the POST
- Telegram should show the message
Limits
This is one-way: alerts in, no guest replies out. Auto-replies need the Beds24 API and a proper bot framework — a separate guide.