skip to content

Linking Chat Accounts

Linking WhatsApp as a device, registering a Telegram bot token, installing Slack and Discord apps, or bridging Signal and iMessage. Interviewers ask what each link costs and where it breaks.

part ofAI coding toolsread it →
on this pageshow

explore

questions

6

In OpenClaw, why does linking WhatsApp need a QR scan from a phone while Telegram needs only a bot token?

level: juniorimportance: must knowfreq 16%

answer

  1. a person's account versus a bot account
  2. WhatsApp Web as a linked device
  3. channels login shows the QR
  4. BotFather token into channels add
  5. session files under credentials/whatsapp

basics

~20 s

OpenClaw reaches WhatsApp through WhatsApp Web as a linked device of a real phone account, so channels login shows a QR the phone must scan; Telegram has a native bot API, so a BotFather token in config is enough.

solid answer

~40 s

WhatsApp has no bot token for a personal assistant: OpenClaw drives **WhatsApp Web** (Baileys) as a **linked device** of an existing phone account, so `openclaw channels login --channel whatsapp` prints a QR you scan from the phone, and the session lands in `~/.openclaw/credentials/whatsapp/<accountId>/creds.json`. Telegram is a bot platform: you create a bot with **@BotFather**, then `openclaw channels add --channel telegram --token <bot-token>` (or `botToken`, `tokenFile`, or `TELEGRAM_BOT_TOKEN` for the default account) is the whole link; Telegram has no `channels login` step. The WhatsApp plugin installs on demand and keeps more state on disk, which is why the docs suggest Telegram first. Either way, `openclaw channels status --probe` confirms the link, and the first DM still meets the pairing policy, which is separate from the QR.

code

bash · 8 lines
bash
# Telegram: the token is the link
openclaw channels add --channel telegram --token <bot-token>

# WhatsApp: link as a device of the phone account (scan the QR)
openclaw channels login --channel whatsapp

# Confirm both accounts with live checks
openclaw channels status --probe

go deeper

for a junior

Recall the two link mechanisms: a QR scan from the phone for WhatsApp with openclaw channels login, and a BotFather token for Telegram with openclaw channels add.

for a middle

Explain why the mechanisms differ: WhatsApp Web makes OpenClaw a linked device of a person's account, while Telegram issues bot credentials. Know the token precedence and where the WhatsApp session file lives.

for a senior

Show you know where each link breaks in operation: an expired QR on a headless host, a revoked linked device, a regenerated token returning 401, and why the credentials folder is as sensitive as a password.

for a principal

Frame channel choice as a cost decision: token channels are cheap and isolated, device-linked channels carry phone-number identity, on-disk sessions and more failure modes, which matters when choosing what a team supports.

## Two kinds of account behind the same Gateway OpenClaw's **Gateway** is the long-running process that holds every chat connection and hands messages to the agent. Each messaging app is a **channel**, and each channel has one or more **accounts**. What it costs to link an account depends on what the platform offers an outside program: - **A bot platform** issues a credential to a program that is not a person. Telegram, Slack and Discord work this way, so linking means pasting a token. - **A person's account** has no bot credential. WhatsApp (for this use), Signal and iMessage work this way, so OpenClaw has to act as one more device or client of a real account. That single difference explains why an operator adding WhatsApp and Telegram on the same evening finds that one needs a phone in hand and the other needs a copy-paste. ## WhatsApp: a linked device of a phone account OpenClaw talks to WhatsApp through **WhatsApp Web** using the Baileys library; there is no separate Twilio WhatsApp channel. The Gateway owns the socket and its reconnect loop. - **Plugin on demand.** The WhatsApp runtime ships outside the core package as `@openclaw/whatsapp`. `openclaw onboard`, `openclaw channels add --channel whatsapp` and `openclaw channels login --channel whatsapp` offer to install it the first time. - **QR-only login.** `openclaw channels login --channel whatsapp` (add `--account work` for a named account) shows a QR. You scan it from **WhatsApp > Linked devices** on the phone, exactly as you would link a desktop client. - **Headless hosts.** On a VPS you need a reliable way to get the live QR to the phone; screenshots or chat attachments can expire in transit. Run `channels login` in a terminal on the Gateway host; an agent's `exec` tool blocks this interactive flow, and the `whatsapp_login` agent tool exists for logging in from chat. - **State on disk.** The linked session is saved as `~/.openclaw/credentials/whatsapp/<accountId>/creds.json` with a `creds.json.bak` backup. That file is the device; whoever holds it can act as the linked device. - **Live listener.** Outbound sends need an active listener for the account and fail fast without one. ## Telegram: a bot token Telegram ships as a bundled plugin, so there is no install step. 1. Chat with **@BotFather** (or open its web app), run `/newbot`, and copy the token. 2. Run `openclaw channels add --channel telegram --token <bot-token>`, or set `channels.telegram.botToken` in `~/.openclaw/openclaw.json`. 3. With the default hot reload the running Gateway picks the change up; otherwise start it with `openclaw gateway`. 4. Check with `openclaw channels status --probe`. Token resolution is account-aware: `tokenFile` beats `botToken`, `botToken` beats the environment, and `TELEGRAM_BOT_TOKEN` only resolves for the **default** account. Telegram does **not** use `openclaw channels login`; running it for Telegram is rejected as an unsupported action. Long polling is the default transport, with webhook mode optional. A wrong token shows up as `getMe returned 401` at startup. ## The other channels in one line each | Channel | What linking costs | Where it usually breaks | |---|---|---| | WhatsApp | QR scan from the phone, plugin install, session files on disk | The phone removes the linked device; QR expires on a headless host | | Telegram | BotFather token | Wrong or regenerated token (`getMe returned 401`) | | Slack | A Slack app: `appToken` with `connections:write` plus `botToken` in Socket Mode, or `botToken` plus `signingSecret` and a public URL in HTTP mode | Missing scopes or events in the app manifest | | Discord | A bot in the Developer Portal, its token in `channels.discord.token`, Message Content Intent enabled | Message Content Intent not enabled for normal guild messages | | Signal | `signal-cli` linked or registered to a number | Linking a personal number, so the bot ignores its owner's own messages | | iMessage | `imsg` on a signed-in Mac with Full Disk Access and Automation | macOS permissions granted to the wrong process | ## What the link does not decide Linking proves OpenClaw can reach the account; it does not decide who may talk to the agent. The first DM from an unknown sender meets the channel's DM policy, which defaults to **pairing**, and approval runs through `openclaw pairing approve`. That approval is a different step from the WhatsApp QR, even though both feel like pairing. Who may message the bot, and how groups are gated, belong with the access-control material. ## Practical takeaways - Start with Telegram when you just want to see the assistant answer; it has the fewest moving parts. - Treat the WhatsApp credentials folder like a password: it is a live login to a phone account. - Verify every new account with `openclaw channels status --probe` rather than by sending a test message and guessing.

  • Can TELEGRAM_BOT_TOKEN in the Gateway's environment supply the token for a second, named Telegram account?
    No. The environment fallback only resolves for the default account. Named accounts need `channels.telegram.accounts.<id>.botToken` or `tokenFile`. Resolution order is `tokenFile`, then `botToken`, then the environment, so config always wins over `TELEGRAM_BOT_TOKEN`.
  • What should you plan for when linking WhatsApp on a headless server?
    Login is QR-only, so you need a dependable path for the live QR to reach the phone; screenshots and chat attachments can expire before you scan. Run `openclaw channels login --channel whatsapp` in a terminal on the Gateway host, because an agent's `exec` tool blocks the interactive flow; from chat, the `whatsapp_login` tool is the supported route.

Telegram hands you a staff badge made for a robot; WhatsApp only lets you in as a second screen of someone's phone, so the phone has to be there to approve it.

  • WhatsApp is linked with a bot token, just like a Telegram bot.
  • Running openclaw channels login for Telegram is how the bot gets connected.
  • Scanning the WhatsApp QR also approves who may message the assistant.
  • TELEGRAM_BOT_TOKEN in the environment overrides the token written in openclaw.json.
  • The WhatsApp session is stored inside openclaw.json with the channel settings.
open as a page

In OpenClaw, what does `openclaw channels status --probe` check that plain `channels status` does not, and when does it fall back?

level: middleimportance: should knowfreq 7%

basics

~20 s

With --probe, the Gateway runs each account's live provider probe and optional audit, reporting results such as works or probe failed; plain status reports runtime state only, and an unreachable Gateway falls back to config-only summaries.

open as a page

Your OpenClaw WhatsApp account went silent after someone removed it from the phone's Linked devices; what happened and how do you recover?

level: seniorimportance: should knowfreq 6%

basics

~20 s

Removing the linked device logs the WhatsApp Web session out; the Gateway stops that account rather than retrying, and status reports the session logged out. Recovery is rerunning openclaw channels login for that account and scanning a new QR.

open as a page

Why are Signal and iMessage harder to connect to OpenClaw than Telegram, and what does each bridge need on the host?

level: middleimportance: nice to knowfreq 4%

basics

~20 s

Neither Signal nor iMessage offers a bot token, so OpenClaw needs a helper: signal-cli acting as a Signal device for a number, and imsg running on a Mac signed into Messages with Full Disk Access and Automation.

open as a page

In OpenClaw, how do you add a second account to a channel already running one, such as a second Telegram bot, and what commonly breaks?

level: seniorimportance: nice to knowfreq 4%

basics

~20 s

Add it under channels.<channel>.accounts with its own id, for example openclaw channels add --channel telegram --account alerts --token; OpenClaw promotes the old top-level settings into the accounts map, and env tokens keep applying only to the default account.

open as a page

Should an OpenClaw assistant on WhatsApp, Signal or iMessage get its own dedicated number and identity, or reuse the operator's personal account?

level: principalimportance: nice to knowfreq 4%

basics

~20 s

The docs recommend a dedicated number or Apple ID on WhatsApp, Signal and iMessage, giving the assistant its own identity; a personal account is supported and cheaper but ties the assistant to one person's phone.

open as a page