Getting started

Connect your channels

reply-chain has two roles. The internal channel is your Telegram back-office, where enquiry briefs and the Quote / Take over / Decline buttons live. A customer channel — Telegram, WhatsApp, or both — is where the AI talks to customers. Connect the internal channel plus at least one customer channel.

How channels are split

On /settings the setup wizard has two channel stages:

StageRoleRequired?
Operator→ Internal channelYour back-office. Enquiry briefs, action buttons, and per-customer topics all land here. Always Telegram.Required
Customer channelsWhere customers chat with the AI. Telegram customer bot and/or WhatsApp.At least one
The internal channel is non-negotiable — there is no WhatsApp equivalent for operator ops. You can run a customer channel on Telegram only, on WhatsApp only, or both. Each stage shows a Connected ✓ badge once its credentials are in.

1. Internal channel (Telegram)

The internal channel is a Telegram group with Topics enabled (a forum supergroup), plus a bot you promote to admin. New enquiries open a topic per customer; the briefs and Quote / Take over / Decline buttons post there.

  1. In BotFather, create a bot for internal use and copy its token, e.g. 987654:XYZ….
  2. In Telegram, create a group — not a channel; only groups support topics.
  3. Open the group settings and turn on Topics. This converts it to a forum supergroup. Converting changes the chat ID, so do it before you read the ID.
  4. Add your internal bot to the group and promote it to admin with Manage Topics.

Finding the internal chat ID

Open the group in web.telegram.org and read the address bar — the ID is the -100… value in the URL:

text
https://web.telegram.org/a/#-1001234567890

Alternatively, send any message in the group and open this URL with your internal bot token:

bash
https://api.telegram.org/bot<INTERNAL_BOT_TOKEN>/getUpdates

The ID is at result[0].message.chat.id — a negative number starting -100. Paste the internal bot token and chat ID into the Operator stage and Save. reply-chain registers the internal webhook for you.

Skipping Topics still works — enquiries just post to one shared stream instead of a topic per customer.

2. Customer channel — Telegram

The simplest customer channel: a second Telegram bot that customers message directly.

  1. In BotFather, create a second bot and copy its token, e.g. 123456:ABC-DEF….
  2. Paste it into the Telegram customer bot token field on the Customer channels stage.
  3. Save. reply-chain registers this bot's webhook automatically — no manual API calls.
Use a different bot from the internal one. The internal bot runs your back-office; the customer bot is the face customers see.

3. Customer channel — WhatsApp

WhatsApp runs on the Meta WhatsApp Cloud API. You bring your own Meta app and paste its credentials — reply-chain routes each operator's webhook by a private per-operator token.

Get your Meta credentials

In the Meta for Developers console, create (or open) an app with the WhatsApp product added, then collect:

FieldWhere to find it
Phone number IDWhatsApp → API Setup. The numeric ID of your sending number.
Access tokenA permanent System User token with whatsapp_business_messaging. (Temporary tokens expire in 24h — use a permanent one for production.)
App secretApp settings → Basic → App Secret. Secures the inbound webhook signature.
WABA ID (optional)Your WhatsApp Business Account ID. Informational.

Paste these into the WhatsApp block on the Customer channels stage and Save. Saving a complete set mints a webhook callback URL and verify token, shown right below the form.

Point Meta at your webhook

Unlike Telegram, Meta's webhook is configured in your Meta app — it is not auto-registered. After saving, copy the two values reply-chain shows and, in your Meta app under WhatsApp → Configuration, set:

Meta fieldValue
Callback URLhttps://your-app/api/whatsapp/webhook/<token> — copied from the form.
Verify tokenThe token string shown beside the callback URL.

Click Verify and save in Meta, then subscribe the app to the messagesfield. The same token answers Meta's verification challenge and secures the callback URL.

The AI replies free-form only inside WhatsApp's 24-hour customer-service window. Out-of-window proactive sends (inactivity nudges, late confirmations) are skipped on WhatsApp for now — message templates come later.
Access token and app secret are stored per operator and never shown back in full. Treat them like passwords — anyone with them can send as your number.

What happens on save

Each stage Save does the wiring for you:

  1. Persists the channel credentials against your operator record.
  2. For Telegram bots, generates the secret webhook token and registers the webhook with Telegram.
  3. For a complete WhatsApp set, mints the callback URL + verify token you paste into Meta.

You activate once the internal channel and at least one customer channel are connected. Persistent failures are covered in Troubleshooting.