# Coexistence Sync

> What syncs between the WhatsApp Business app and Avox on a Coexistence connection - chat history, contacts, and messages sent from the phone.

Source: https://docs.theavoxai.com/connections/coexistence

With a **Coexistence** connection, the same WhatsApp number works in the WhatsApp Business app on
your phone and in Avox at the same time. This page explains what moves between the two, and where you
see it in your dashboard. For the idea behind Coexistence itself, see
[Coexistence, explained](https://docs.theavoxai.com/coexistence-explained).

You choose Coexistence in step 1 of the [setup wizard](https://docs.theavoxai.com/connections/setup) as **Existing number
(Coexistence)**. A **New number (Bot only)** connection has no phone app, so nothing on this page
applies to it.

## What syncs, at a glance

| From the WhatsApp Business app | When | Where it shows in Avox |
| --- | --- | --- |
| Your chat history | Once, right after you connect - only if you chose to share it | The [Inbox](https://docs.theavoxai.com/inbox), and new contacts in [Contacts](https://docs.theavoxai.com/contacts) |
| Your contacts and their names | After you connect, and whenever the app's contact list changes | Contact names in [Contacts](https://docs.theavoxai.com/contacts), the Inbox, and Calls |
| Messages your team sends from the app | As they're sent | The customer's conversation in the [Inbox](https://docs.theavoxai.com/inbox) |
| Messages customers send to your number | As they arrive | The [Inbox](https://docs.theavoxai.com/inbox) |

Each of these reaches Avox as an event from Meta, which you can see in [Logs](https://docs.theavoxai.com/logs) under the event
types `history`, `smb_app_state_sync`, `smb_message_echoes`, and `messages`. See
[Meta webhooks](https://docs.theavoxai.com/whatsapp/webhooks) for what each contains.

## Chat history import

During signup, the WhatsApp Business app on your phone asks how to handle your existing chats: share
all of them, or start new threads with current customers. This is a one-time choice made in the app
and it can't be changed later.

If you share your history:

1. Meta sends the history to Avox shortly after you connect, in batches.
2. Each message is added to the matching customer's conversation in the [Inbox](https://docs.theavoxai.com/inbox) at its
   original date and time - both what customers sent and what you sent from the phone - with a new
   contact created for any number Avox hasn't seen yet.
3. Imported messages are stored once. If Meta resends a batch, nothing is duplicated.

Customer messages in the imported history count toward the received totals on
[Overview](https://docs.theavoxai.com/overview) for the days they cover. Sent totals and the delivery rate follow the messages
you send from Avox. [Automations](https://docs.theavoxai.com/automation) respond only to new messages, so imported history never
triggers them.

## Contact sync

Your WhatsApp Business app's contacts sync into Avox. For each synced contact:

- A contact is created in [Contacts](https://docs.theavoxai.com/contacts) if the number is new to Avox.
- The name from your app's contact list becomes the contact's name in Avox.

When a name changes later in the app's contact list, Avox picks up the new name. You can still rename
a contact in Avox at any time - see [Renaming a contact](https://docs.theavoxai.com/contacts#renaming-a-contact) - but a later
change in the app's contact list replaces it.

Removing someone from the phone's contact list keeps them in Avox, with their whole conversation.

## Messages sent from the phone app

When someone on your team replies from the WhatsApp Business app instead of Avox, Meta tells Avox
about it, and the reply appears in that customer's conversation in the [Inbox](https://docs.theavoxai.com/inbox) at the time it
was sent. Everyone sees
the full conversation, whichever device each reply came from, so nobody answers the same customer
twice.

## New messages

Every message a customer sends to your number arrives in Avox and in the WhatsApp Business app.
Your team can answer from either.

## Things to know

- **Keep the app installed and signed in.** The phone app and Avox share one number. Removing the
  number from the WhatsApp Business app, or registering it somewhere else, affects the connection. If
  your connection shows **Disconnected** or **Error**, see [Health](https://docs.theavoxai.com/health).
- **The 24-hour window applies everywhere.** Replies from the Inbox follow WhatsApp's
  [messaging window](https://docs.theavoxai.com/whatsapp/messaging-window) rules.
- **Your team sees everything.** Everyone in the Switchboard - Admins and Managers - sees synced
  history and contacts. See [Members and roles](https://docs.theavoxai.com/switchboard/members).
- **Forwarding sends new customer messages only.** With
  [Message forwarding](https://docs.theavoxai.com/connections/webhook-override) on, new messages customers send are forwarded to
  your server; imported history and replies sent from the phone stay in Avox.
- **Event timing.** Sync arrives as events from Meta and is processed in the order received. A large
  history import can take a little while. Watch progress in [Logs](https://docs.theavoxai.com/logs).

## Troubleshooting

| You see | Try this |
| --- | --- |
| No chat history after connecting | History arrives only if you chose to share it on your phone during signup. Check [Logs](https://docs.theavoxai.com/logs) for `history` events. That choice can't be changed later. |
| A contact's name keeps changing back | The name comes from your phone's WhatsApp Business contact list. Change it there, or rename the contact in Avox after the sync. |
| Replies from the phone don't appear | Check [Logs](https://docs.theavoxai.com/logs) for `smb_message_echoes` events and their status, and the connection on [Health](https://docs.theavoxai.com/health). |
| An event shows `failed` in Logs | Open it to read the error, then see [Logs](https://docs.theavoxai.com/logs#when-events-fail). |
