← All articles
Developer API, MCP and webhooks·

Set up Getwello with Telegram

Build a tiny Telegram bot that posts check-ins to a private group. 5 minutes with @BotFather.

Telegram has the cleanest bot API of any chat platform. This guide builds a bot that posts Getwello events to a private family group.

What you need

  • Telegram on your phone.
  • A Getwello Coordinator account with active subscription.
  • 5 minutes for the bot, another 5 for the relay.

Step 1: Create the bot

  1. Open Telegram, search for @BotFather, start a chat.
  2. Send /newbot. Pick a display name (e.g. “Mum check-in bot”) and a username ending in “bot”.
  3. BotFather replies with an API token. Copy it.

Step 2: Create a private group and add the bot

  1. In Telegram, create a new group with the family members you want.
  2. Add your bot as a member.
  3. Find the group's chat ID: easiest is to use @username_to_id_bot, or send a message in the group then call https://api.telegram.org/bot<TOKEN>/getUpdates and look for the chat ID (negative number).

Step 3: Build a tiny relay

Telegram bots send messages by calling their API. Wrap our webhook to do that. Cloudflare Worker example:

export default {
  async fetch(req, env) {
    const evt = await req.json();
    const text = evt.event === 'check_in.created'
      ? `*Mum has just checked in*\n_${evt.occurred_at} · Mood: ${evt.data.mood ?? 'n/a'}_`
      : `*${evt.event}*\n${JSON.stringify(evt.data)}`;
    await fetch(`https://api.telegram.org/bot${env.TG_TOKEN}/sendMessage`, {
      method: 'POST',
      headers: { 'content-type': 'application/json' },
      body: JSON.stringify({
        chat_id: env.TG_CHAT_ID,
        parse_mode: 'Markdown',
        text
      })
    });
    return new Response('ok');
  }
};

Step 4: Create the Getwello webhook subscription

Settings → Developer API → Webhooks. URL is your relay. Tick the events you want.

Test

Click Test. The bot posts in your Telegram group within a second or two.

Troubleshooting

Bot can't post: the bot must be a member of the group, and (for newer Telegram) admin permissions help.

Markdown looks wrong: Telegram has two markdown modes. Try MarkdownV2 with proper escaping if Markdown breaks.

More on developer api, mcp and webhooks

Didn't answer your question?

Email hello@getwello.co.uk