Guides/How to get Telegram notifications for form submissions

How to get Telegram notifications for form submissions

Form submitted. Telegram message. No middleware, no serverless functions.

Updated March 2026

You have a form. You want to know when someone fills it out. Instead of checking a dashboard, you get a Telegram message on your phone. Sutrena has a built-in Telegram template that formats submission data as a clean HTML message and sends it through the Telegram Bot API. You create a bot, grab the chat ID, and wire it up. Three API calls. This guide walks through two real scenarios: a newsletter signup (one field, simple) and a shopping order form (multiple fields, practical). Both end with a Telegram message on your phone within seconds of submission.

1. Create a Telegram bot

Open Telegram and message @BotFather. Send /newbot, pick a name and username. BotFather gives you a token like 7794071204:AAE1dQKEoggYLGsmuBcx-ALV5Gs_dwhnpMo. This is your bot's API key -- save it. The bot is yours. It sends messages on your behalf. You don't need to write any bot code.

2. Get your chat ID

You need the numeric chat ID where the bot should send messages. Three options: • **Personal chat:** Message @userinfobot on Telegram. It replies with your chat ID. • **Group chat:** Add @RawDataBot to the group temporarily. It prints the group's chat ID (a negative number like -100123456789). Remove it after. • **Channel:** Add your bot as an admin to the channel. The channel ID is the numeric part you see in the channel's invite link, prefixed with -100. For this guide, we'll use a personal chat.

3. Scenario 1: Newsletter signup (Asish Panda Labs)

A real newsletter form with one field -- email. The goal: every time someone subscribes, you get a Telegram message instantly. Create the form first.

# Get an API key (or use one you have)
curl -X POST https://sutrena.com/api/trial

# Create a simple newsletter form
curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Asish Panda Labs Newsletter",
    "fields": [
      { "name": "email", "label": "Email", "type": "email", "required": true }
    ],
    "successMessage": "You are in. Watch your inbox.",
    "submitLabel": "Subscribe"
  }'

4. Wire up the Telegram webhook

Create a webhook with template: "telegram". The URL points to your bot's sendMessage endpoint. The telegramChatId tells Sutrena where to deliver. Use formIds to link the webhook to your newsletter form in one step.

curl -X POST https://sutrena.com/api/webhooks \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.telegram.org/botYOUR_BOT_TOKEN/sendMessage",
    "template": "telegram",
    "telegramChatId": "YOUR_CHAT_ID",
    "description": "Newsletter signups to Telegram",
    "formIds": ["YOUR_FORM_ID"]
  }'

# Response includes the webhook ID and a signing secret.
# The signing secret is shown once -- save it if you
# need HMAC verification later.

5. Test the newsletter flow

Submit to the form. Check your phone. You'll get a Telegram message that looks like: **New: Asish Panda Labs Newsletter** **email**: [email protected] Bold labels, clean formatting, instant delivery.

# Submit a test entry
curl -X POST https://sutrena.com/api/forms/YOUR_FORM_ID/submit \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'

# Check Telegram -- the message arrives in seconds.

# You can also verify delivery programmatically:
curl https://sutrena.com/api/webhooks/WEBHOOK_ID/deliveries \
  -H "Authorization: Bearer YOUR_KEY"

6. Scenario 2: Shopping order notifications

More fields, same pattern. A small bakery takes cake orders online and wants a Telegram notification for each one. The message shows every field so they can start baking without opening a dashboard. Create the order form with all the fields.

curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cake Orders",
    "fields": [
      { "name": "name", "label": "Name", "type": "text", "required": true },
      { "name": "phone", "label": "Phone", "type": "tel", "required": true },
      { "name": "cake_type", "label": "Cake type", "type": "select",
        "options": ["Birthday", "Wedding", "Custom"], "required": true },
      { "name": "flavor", "label": "Flavor", "type": "select",
        "options": ["Chocolate", "Vanilla", "Red Velvet", "Lemon"] },
      { "name": "size", "label": "Size", "type": "select",
        "options": ["6-inch", "8-inch", "10-inch"] },
      { "name": "delivery_date", "label": "Delivery date", "type": "date", "required": true },
      { "name": "notes", "label": "Special notes", "type": "textarea" }
    ],
    "successMessage": "Order received! We will confirm shortly.",
    "submitLabel": "Place Order"
  }'

7. Add a Telegram webhook for orders

Same bot, same chat, different form. Or use a group chat so your whole team sees the order. The Telegram message will show every field. For a cake order, the baker sees name, phone, cake type, flavor, size, delivery date, and notes -- all in one message.

curl -X POST https://sutrena.com/api/webhooks \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.telegram.org/botYOUR_BOT_TOKEN/sendMessage",
    "template": "telegram",
    "telegramChatId": "YOUR_CHAT_ID",
    "description": "Cake orders to Telegram",
    "formIds": ["YOUR_ORDER_FORM_ID"]
  }'

# When someone orders a wedding cake, you get:
#
# **New: Cake Orders**
#
# **name**: Sarah Chen
# **phone**: +1-555-0142
# **cake_type**: Wedding
# **flavor**: Vanilla
# **size**: 10-inch
# **delivery_date**: 2026-04-15
# **notes**: White fondant, gold leaf accents

8. Send to a group chat (optional)

If multiple people need to see orders -- a baker and a delivery person, for example -- use a Telegram group. 1. Create a group in Telegram 2. Add your bot to the group 3. Get the group's chat ID (add @RawDataBot, note the negative number, remove it) 4. Use that group chat ID as telegramChatId Everyone in the group sees every order. No dashboard login needed.

# Update an existing webhook to use a group chat
curl -X PATCH https://sutrena.com/api/webhooks/WEBHOOK_ID \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"telegramChatId": "-100987654321"}'

9. Combine with a dashboard (optional)

Telegram for instant alerts, dashboard for the big picture. You can have both on the same form. Create a dashboard alongside the form, and keep the Telegram webhook. Submissions hit both -- instant notification on your phone, running totals on your screen.

# Create a dashboard for the order form
curl -X POST https://sutrena.com/api/dashboards \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "formId": "YOUR_ORDER_FORM_ID",
    "title": "Cake Orders",
    "isPublic": true,
    "dsl": {
      "version": 1,
      "widgets": [
        { "type": "metric_card", "title": "Total orders", "value": "count(*)" },
        { "type": "pie_chart", "title": "By cake type", "groupBy": "cake_type" },
        { "type": "bar_chart", "title": "Orders per day", "groupBy": "$submitted_at:day" },
        { "type": "data_table", "title": "Recent orders", "columns": ["name", "cake_type", "delivery_date", "phone"] }
      ]
    }
  }'

FAQ

How do I create a Telegram bot?

Message @BotFather on Telegram, send /newbot, pick a name and username. It takes about 30 seconds. You get a token that looks like 123456:ABC-xxx. That's your bot's API key.

Where do I find my chat ID?

Message @userinfobot on Telegram for your personal chat ID. For group chats, add @RawDataBot temporarily -- it prints the chat ID in its first message. Group IDs are negative numbers.

Can one bot send to multiple chats?

Yes. Create separate webhooks with the same bot token URL but different telegramChatId values. Each webhook goes to a different chat. You can link them to the same or different forms.

What does the Telegram message look like?

An HTML-formatted text message with the form name in bold at the top, then each field on its own line as bold label: value. Clean and readable -- no images, no buttons, just the data.

Can I use field mapping with the Telegram template?

Yes. Field mapping runs before the template. If you set fieldMapping: {"email": "subscriber_email"}, the Telegram message shows "subscriber_email" as the label instead of "email".

What if Telegram is down?

Sutrena retries with exponential backoff. Check delivery status with GET /api/webhooks/{id}/deliveries. After 10 consecutive failures, the webhook auto-deactivates -- re-enable it with PATCH when Telegram is back.

Is there a message limit?

Telegram limits bots to about 30 messages per second globally, and 1 message per second per chat. Sutrena sends one message per form submission, so you'd need a very high-traffic form to hit this.

Can I switch between personal chat and group chat later?

Yes. PATCH /api/webhooks/:id with a new telegramChatId. The bot just needs to be a member of the target group.

What is Sutrena?

Sutrena is the web runtime for AI agents. Forms, Pages, Dashboards, Analytics, Webhooks, Automations, Emails — all through 75 MCP tools and one REST API. Your agent creates web artifacts, humans interact with them, and your agent gets the data back. Use any one feature or all of them together.

Pages

Deploy HTML instantly

Forms

Collect structured data

Dashboards

Visualize with 7 widget types

Analytics

Privacy-first, no cookies

Webhooks

Slack, Discord, Telegram

Get started in two API calls

1. Get a trial key (no auth, no signup)

curl -X POST https://sutrena.com/api/trial

2. Create anything — a page, form, dashboard, or analytics site

# Create a form with a dashboard
curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"workflowId": "waitlist", "createDashboard": true}'

# Or deploy a page
curl -X POST https://sutrena.com/api/pages \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"slug": "index", "title": "My Site", "html": "<h1>Live</h1>"}'

Ready to build?

Get a trial API key instantly with no signup, or create an account for the full experience.

How to get Telegram notifications for form submissions — Sutrena | Sutrena