Documentation menu

Error alerts to Telegram

Send application errors to your phone via Telegram, filtered so only the things that matter interrupt you.

Telegram is the cheapest way to get real push notifications on your phone — no app to build, no per-seat pricing. Paired with a topic's minimum-level rule, it becomes a decent on-call channel: you send every error, and only the serious ones ring.

1. Connect Telegram

Your organization gets its own private Telegram bot — created for you, inside Telegram, in about a minute. You never touch a bot token or a chat ID.

Once per organization (owners/admins): open Connections → New Connection, choose Telegram, and tap Start when the setup hands you to Telegram. Telegram shows a native Create bot button; one tap and EventSend finishes the technical setup automatically.

Then, per person: open Destinations → Add Destination, choose Telegram, and click Send alerts to me. Tap Start on your organization's bot and you're connected. Each teammate gets one personal destination — everyone connects their own phone, and you can attach all of them to the same topic.

Admins can also click Telegram group or Telegram channel to alert a whole team chat: Telegram opens its native chat picker, EventSend verifies it can post there, and one destination keeps everyone in sync.

The links work with the Telegram app or Telegram Web — whichever you have. If you switch devices or reload mid-setup, just pick up where you left off; the setup waits for you.

2. Send errors from your app

Send an event from wherever you already handle exceptions. Use error for things that are broken and critical for things that are broken and losing money or data — that distinction is what lets you filter later.

async function reportError(err, context = {}) {
await fetch("https://eventsend.io/api/events", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EVENTSEND_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
event: "app-error",
message: `${err.name}: ${err.message}`.slice(0, 500),
level: "error",
icon: "🔥",
unique_key: `${err.name}-${context.requestId ?? Date.now()}`,
payload: { route: context.route, user_id: context.userId },
}),
});
}
import hashlib
import os
import requests
def report_error(exc, route=None):
fingerprint = hashlib.sha256(f"{type(exc).__name__}:{exc}".encode()).hexdigest()[:32]
requests.post(
"https://eventsend.io/api/events",
headers={"Authorization": f"Bearer {os.environ['EVENTSEND_TOKEN']}"},
json={
"event": "app-error",
"message": f"{type(exc).__name__}: {exc}"[:500],
"level": "error",
"icon": "🔥",
"unique_key": fingerprint,
"payload": {"route": route},
},
timeout=5,
)

The unique_key is a deliberate choice. Keyed on an error fingerprint, the first occurrence of a given error gets through and identical repeats return 409 — one alert for a bad deploy instead of four hundred. Keyed on a request id instead, you get one alert per affected request. Pick whichever matches how you want to be interrupted.

Send errors in the background, never blocking the request you're already failing, and never let the reporting call throw an exception of its own.

3. Route only what should wake you

Create a topic:

  • Connect it to your application's route and to your Telegram destination.
  • Set the minimum level to error.
  • Leave the event pattern blank so every error event qualifies, whatever it's called.

Now default, success, and warning events flow to your other destinations and never reach your phone, while error and critical do.

If your phone is still too busy, raise the minimum level on that topic to critical and add a second topic at error pointing to Slack. Same events, two thresholds, two channels.

4. Test it

Send yourself a critical event:

curl -X POST https://eventsend.io/api/events \
-H "Authorization: Bearer es_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event": "app-error",
"message": "Test alert: database connection pool exhausted",
"level": "critical",
"icon": "🔥",
"payload": {"test": true}
}'

Your phone should buzz. If it doesn't, check the event in the dashboard: an event marked dropped means no topic matched it — usually the minimum level is set higher than the level you sent, or the topic isn't connected to both the route and the destination.