waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] - Brazil all numbers had an extra 9 digit - Waha report some errors in Waha logs but doesnt return these errors in webhook

Open mhaxabreu opened this issue 5 months ago • 3 comments

Describe the bug

In Brazil, all numbers had an extra 9 digit added in 2017. For WhatsApp, some numbers have been updated with the 9th digit(+55XX 9XXXX-XXXX) and some others doesn't have (+55XX XXXX-XXXX).

When any user/application tries to send a message to a number who should have the 9th digit but does not have, Waha is not delivering the message to the destination, but it responds webhook with code 201. The problem is: Waha is generating warns and errors on it own logs, but it is not forwarding these errors in the returned webhook return for the application. Example of logs generated in waha: [22:18:15.909] WARN (7): [Session/7_8_##########/Client] Server returned different participant list hash (2:bdLS8Wb3 != 2:demrcVWp) when sending to 5516########@s.whatsapp.net. Some devices may not have received the message. {"engine":"gows"} [22:18:16.038] ERROR (7): [Session/7_8_##########/Client] Failed to issue privacy token for 5516########@s.whatsapp.net: info query returned status 400: bad-request {"engine":"gows"}

It only sends a normal webhook return with ack=1 but no errors or warnings like it shows in the logs; This way, application does not receive the information that it made a bad request or that the destination may not have received the message.

Version

Waha version: 2026.5.1

Steps

To Reproduce Steps to reproduce the behavior:

  1. Find a brazillian number that WhatsApp register with the 9th digit (Example +55 19 98040-4005)
  2. Try to send a message to it without the 9th digit (Example +55 19 8040-4005)
  3. See error

Expected behavior

Waha should forward aditional warnings or errors in thewebhook requests

mhaxabreu avatar Jun 18 '26 02:06 mhaxabreu

You need to check the phone number before sending a message

https://waha.devlike.pro/docs/how-to/contacts/#check-phone-number-exists

GET /api/contacts/check-exists?phone=11231231231&session=default
{
  "numberExists": true,
  "chatId": "[email protected]"
}

patron:PRO

devlikepro avatar Jun 27 '26 09:06 devlikepro

You need to check the phone number before sending a message

https://waha.devlike.pro/docs/how-to/contacts/#check-phone-number-exists

GET /api/contacts/check-exists?phone=11231231231&session=default

{ "numberExists": true, "chatId": "[email protected]" } patron:PRO Community reports that using this checkphone endpoint highly increases chance of number being banned in WhatsApp. Can we trust that using this feature is safe?

mhaxabreu avatar Jun 27 '26 12:06 mhaxabreu

Hello! Basically, there is no way to tell whether an account was registered before or after the addition of the extra digit '9'. Therefore, the only way to handle this is by using the check-exists API—simply run it once per contact and store the result somewhere in your database.

Note for 🇧🇷 Brazilian Phone Numbers You should use the GET /api/contacts/check-exists endpoint before sending a message to a new phone number to get the correct chatId because of the additional 9-digit number added after 2012. Read more about error sending text to half of Brazilian numbers (every number registered before 2012) -> It’s fine to send the response to chatId for incoming messages, though - the payload already has the correct chatId.

patron:PRO

devlikepro avatar Jul 08 '26 03:07 devlikepro