Case study
WhatsApp unified inbox - Centralizing 24 to 28 numbers





Context
A client based in Switzerland talks with customers over 24 to 28 WhatsApp numbers, both standard and Business accounts, each installed on its own Android phone. Without a shared tool, each conversation can only be read on its line's phone: no overview, no central notifications, no search from one line to another.
The mission: deliver a single inbox, on desktop, in the browser and on iPhone, where each message arrives with its line and contact, and from which the reply goes back out through the right number. All of it installed on a server in the client's name, without removing the numbers from their phones, and keeping messages and history on the client's side.
Problem & goals
Problem
- 24 to 28 numbers spread across as many phones: impossible to follow conversations without switching from one device to another
- The official WhatsApp Business API was ruled out: it removes the number from the phone and rejects personal accounts, whereas each phone had to remain fully usable
- Tools that drive one browser per account would have needed more than 10 GB of memory for 28 accounts
- WhatsApp unlinks a linked device when the phone stays offline for about 14 days: a line can drop without anyone noticing
- Sensitive data: messages, contacts and history were not to depend on any third-party service, and everything had to stay in the client's name
Goals
- Bring every line into a single inbox: line and contact identified, direct access to the conversation, reply sent through the right number, search across all lines
- Keep each number on its original phone, which remains the main device
- Notify every incoming message on iPhone, with the screen locked and the computer off, naming the line and the contact
- Monitor the lines: automatic reconnection, alert when a line drops, tracking of phones that have been offline too long
- Guarantee confidentiality and reversibility: data on the client's server, logs without message content, named and revocable access
- Size the platform for all the lines, with batch onboarding the client can carry out alone
- Validate the solution in real conditions on both account types, standard and Business, against six measurable criteria defined with the client
Approach
The technical choices were made on quantified constraints, then tested on real lines rather than on paper:
- comparison of the options: official API ruled out (it removes the number from the phone), browser automation ruled out (one Chrome per account), chosen: Evolution API with the Baileys engine, which speaks the multi-device WhatsApp Web protocol directly, without a browser;
- each number becomes a linked device, like WhatsApp Web: it takes one of the account's 4 slots, and the phone keeps all its functions;
- Chatwoot as the single interface (web and iOS app), one inbox per line, on a Hetzner server in the client's name, with Docker Compose behind Caddy for HTTPS;
- pinned and documented versions, no latest tag: every upgrade is tested on a single line before being rolled out;
- diagnosis of a pairing failure that appeared on WhatsApp's side in late July 2026, which no published version of Baileys fixed: Evolution API image rebuilt with the upstream fix, verified at build time;
- a validation protocol with six criteria (receipt in the inbox, phones untouched, notification, reply from the notification, 72 hours without an unrecovered drop, automatic recovery in under 10 minutes after a deliberate network outage), measured by an automatic minute-by-minute log;
- scripts and documentation written so that the client can add or remove a line alone.
The pitfalls found on the real lines (pairing, sending from Chatwoot, known Evolution API issues) are fixed or documented in the delivered repository.
Technical highlights
Architecture: Docker Compose: Evolution API 2.3.7 (one instance per number), Chatwoot 4.18 (web interface and iOS app), PostgreSQL 16 with one database per service, Redis 7, Caddy 2 for automatic HTTPS. Only Caddy is exposed to the Internet; Evolution API only listens locally, and its manager opens through an SSH tunnel.
Pairing fix: Since late July 2026, WhatsApp sends a notification during pairing that Baileys acknowledged without processing: the QR code kept renewing without ever completing. The image is built on the official image pinned by digest, with Baileys upgraded to 7.0.0-rc14 with the not-yet-published upstream fix, plus a one-line fix written for this deployment: the 8-character pairing code stays the same for the whole series instead of changing every 20 seconds. The build fails if a fix is missing.
iPhone notifications: A Ruby initializer mounted in Chatwoot, without changing its image, overrides three methods: every incoming message notifies the members of its line's inbox (Chatwoot only notified the assigned person), the title names the line, and a setting removes the preview on the server side so that no content goes out to the notification relay and Apple.
Monitoring: The state of each session is logged every minute, with no content and no number. A line disconnected for more than 10 minutes triggers an alert in a Chatwoot “Supervision” inbox, and therefore on the iPhone, then a message when it comes back. Every Monday, a summary: availability per line, phones with no activity for 10 days, backups, disk, new versions and merged upstream fixes.
Operations: Python scripts with no external dependency to connect, re-pair or remove a line: inbox, color label, automation rule and notifications set up with one command, which can be rerun without side effects. Nightly database backups with a restore test, and a deliberate, timed network outage for validation.
Security & reversibility: Hardened server (key-only SSH, root access disabled, firewall, automatic security updates), secrets generated outside the repository, two-factor authentication on accounts, rotated logs without message content, named access and a revocation procedure, an encrypted archive to rebuild everything on another server.
Results
The project delivered a platform designed for all the lines:
- the complete foundation on the client's server, sized for 28 lines with headroom (up to about 32): HTTPS, daily backups, externalized secrets, two-factor authentication;
- a solution validated in real conditions on both account types, standard and Business, with a protocol measured minute by minute, the phone remaining the main device;
- a unified inbox: line and contact identified on every conversation, a color label per line all the way to the iPhone, reply sent through the right number, search across all lines at once;
- iPhone notifications that name the line and the contact, with or without a preview, as the client chooses;
- monitoring that raises alerts in the inbox itself, complemented by a weekly summary;
- tooled onboarding: each line is connected with one command, in batches of 4 to 5, with memory and stability checks between batches;
- nine operations documents, from the user guide to reversibility, and a quantified study of network egress to split the lines into 6 batches.
Adding a line takes one command and a few minutes, phone in hand, and the procedure is written so that the client can do it alone.
What I learned
- choosing an architecture based on quantified constraints (memory, linked devices, keeping the numbers) rather than on a tool's popularity;
- diagnosing a regression in a third-party library, following the upstream fix and integrating it into a pinned, verifiable image;
- extending an existing application without forking it, through a targeted, documented initializer to recheck at every upgrade;
- defining measurable validation criteria with the client, and building the tools to prove them rather than just claiming them;
- designing useful monitoring: few alerts, in the right place, with the steps to follow;
- thinking about confidentiality and reversibility from the start: data on the client's side, logs without content, revocable access.
This project taught me that a reliable integration depends as much on the rigor around it as on the code: pinned versions, measurements, documentation and procedures the client can follow alone.