# Connect WhatsApp

WhatsApp Business Cloud is the official, recommended way to connect WhatsApp to PiGi. The older QR-pairing connection (WhatsApp via Baileys) links a phone like WhatsApp Web; it is unofficial, WhatsApp can ban a number used this way, and a new number should not be paired by QR. This guide covers the QR connection's Phone session, Announcement group and Send a test message controls for schools already using it.

Source: https://help.pigi.io/guides/company-setup/notifications/connect-whatsapp

## Quick answers

**What is the best way to connect WhatsApp to PiGi?**
WhatsApp Business Cloud. It is Meta's official route for business messaging and the
recommended way to send WhatsApp from PiGi. Pairing a phone by QR code is an older,
unofficial connection, and WhatsApp can ban a number used this way.

**Should I pair a new number by QR code?**
No. Set up WhatsApp Business Cloud instead. The QR connection is only for schools that
already use it.

**I have both WhatsApp Business Cloud and a QR-paired phone. Which one sends?**
WhatsApp Business Cloud, whenever it is connected with its access token and phone number
ID saved. The QR-paired phone is only used when WhatsApp Business Cloud is off or
incomplete. The provider picked on the notification methods screen makes no difference.

**Where is the QR code?**
Company → Settings → Integrations, click **WhatsApp via Baileys** (or **Baileys
WhatsApp**), then **Phone session**. Click **Connect WhatsApp**; the badge moves to
**Connecting…** and then **Scan QR code**, and the code appears with "Scan this QR code
with WhatsApp on your phone". It refreshes itself every few seconds.

**Does reconnecting keep my old WhatsApp link?**
No. **Connect WhatsApp** or **Retry connection** on a disconnected or failed session
throws the old pairing away, so someone holding the phone must scan a new QR code.

**How do I know if WhatsApp is connected right now?**
The **Phone session** row shows a **Connected** badge and "Linked to" the paired number.
A red WhatsApp icon appears in the admin header only when something is wrong; a quiet
header means the session is healthy.

**How do I check WhatsApp actually sends?**
While the phone is connected, click **Send a test message**, enter a **Recipient phone
number** such as +27 21 000 0000 and a **Message**, and click **Send**.

**Why does Announcement group say "Link the phone first."?**
The group list comes from the linked phone, so **Announcement group** and **Send a test
message** only open while the phone session is **Connected**.

## What this is

PiGi can send WhatsApp two ways. **WhatsApp Business Cloud** is the official,
recommended route; see
[Send notifications with WhatsApp Business Cloud](../integrations/whatsapp-business.md).
The older way, **WhatsApp via Baileys**, links an ordinary WhatsApp phone to PiGi by QR
code, like WhatsApp Web. That QR connection is unofficial, WhatsApp can ban a number used
this way, and a new number should not be paired by QR; see
[WhatsApp by QR code](../integrations/whatsapp-qr.md). When both are connected, WhatsApp
Business Cloud sends every individual message. This guide covers the QR connection's
screens for schools already on it.

## Before you start

- You need the **admin** role to connect, disconnect and see the QR code.
- Have the phone in your hand. Every reconnect is a fresh QR scan.
- Use a number you are happy to leave linked. Unlinking PiGi on the phone drops the
  connection.

## Steps

1. Open **Company → Settings → Integrations** and click **WhatsApp via Baileys** (shown
   as **Baileys WhatsApp** on some accounts). If it is not connected yet, click
   **Connect WhatsApp via Baileys**.
2. Click **Phone session**. The dialog reads "The WhatsApp account PiGi sends from."
3. Click **Connect WhatsApp**. The badge moves to **Connecting…**, then **Scan QR code**.
4. On the phone, open WhatsApp's linked devices screen, choose to link a device, and scan
   the code.
5. Wait for the badge to read **Connected** with the phone number underneath, then click
   **Close**.
6. Click **Send a test message** and send yourself a message.
7. Optional: click **Announcement group**, then **Choose a group**, and pick the WhatsApp
   group trip announcements go to with **Use this**.

## Phone session badges and buttons

| Badge | Meaning | Button |
|---|---|---|
| Not connected | No session has been started yet. | **Connect WhatsApp** |
| Disconnected | The session is down. | **Connect WhatsApp** |
| Connecting… | PiGi is starting the session; a QR code follows. | **Cancel** |
| Scan QR code | A code is on screen, waiting for the phone. | **Cancel** |
| Connected | Live. The paired number shows under the heading. | **Disconnect this phone** |
| Error | The message underneath says what WhatsApp reported. | **Retry connection** |

When the phone is not connected, the dialog also gives the reason in plain English, for
example "The phone unlinked this device. Scan a new QR code to pair again." or "WhatsApp
closed the connection. This is routine — it reconnects on its own within a few seconds."

## Reconnecting from the header

When the QR connection drops, a red WhatsApp icon appears in the admin header for
**admin** and **bookings** users. Hovering shows the reason. Clicking it opens a
**WhatsApp** dialog with the same session controls, the **Trip announcements** group
picker and a test message form, so you can reconnect without leaving the page.

## Known limitations

- **Unofficial connection.** WhatsApp can ban a number paired by QR. Move to WhatsApp
  Business Cloud.
- **Reconnecting always needs the phone.** There is no reconnect without a fresh scan.
- **One phone per company.** Linking the same WhatsApp account elsewhere can knock PiGi
  off: "Another device took over this WhatsApp session. Only one can be linked at a
  time."
- **Bookings users can't finish a reconnect.** They can start one from the header, but
  only an admin sees the QR code and can cancel or disconnect.
- **Disconnecting notifies Telegram.** **Disconnect this phone** sends an alert to your
  linked Telegram chats saying the session was stopped.
- **PiGi heals some failures on its own.** A session stuck for a long time, or whose QR
  code expired unscanned, is restarted automatically, but a restart that needs a scan
  still waits for someone with the phone.

## Related

- [Send notifications with WhatsApp Business Cloud](../integrations/whatsapp-business.md)
- [WhatsApp by QR code (legacy connection)](../integrations/whatsapp-qr.md)
- [Choose how notifications reach people](notification-methods.md)
- [Notification troubleshooting](notification-troubleshooting.md)
- [Connect Telegram alerts](connect-telegram.md)
