Data synchronization between WhatsApp and Green-API#
Data synchronization ensures the correct functioning of the Green-API instance, including sending and receiving messages, working with contacts, encryption, and access to chat history.
When is synchronization enabled?#
1. Connecting to the instance#
When you first connect to the instance or re-authorize, the system automatically initiates synchronization:
- All available account contacts are loaded,
- The message history is pulled in,
- Encryption keys are checked and updated.
2. Transferring a WhatsApp account to another device#
When transferring a WhatsApp account to a new device:
- New encryption keys are generated,
- Re-authorization in Green-API is required,
-
Synchronization is launched, including:
- Updating encryption keys,
- Loading the history of recent dialogues,
- Synchronizing the contact list.
Instance status starting
#
During synchronization, the instance enters the starting
status.
This is a technical status, meaning that synchronization is active.
- Typically lasts from a few seconds to a couple of minutes
- Some API requests may not be available during this time
If the instance remains in the
starting
status for a long time (more than 5 minutes), this may indicate a hang. In this case, it is recommended to reboot the instance.
Important requirements#
Warning
Do not close the application or interrupt the process while the synchronization window is open!
The app must remain active on the screen - switching to the background, locking the screen, or turning off the device may interrupt the synchronization.
While synchronization is not complete:
- Contacts will not be downloaded
- Chat history will not be available
If the device is inactive or turned off, synchronization will not complete and the instance may remain in the starting
status.
Synchronization completes automatically. Once it is complete, you can continue working with the instance.
Recommendations#
1. Make sure the device is connected to a stable internet connection
2. Wait for synchronization to complete before performing any operations via the API
3. If errors occur, re-authorize