evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

[Bug] Typebot fails to send messages to users with LID - BadRequestException jidOptions.exists false

Open RelaxSolucoes opened this issue 2 months ago • 14 comments

Welcome!

  • [x] Yes, I have searched for similar issues on GitHub and found none.

What did you do?

  1. Created a Typebot integration on Evolution API instance v2.3.6
  2. Configured the bot with trigger type "all" to respond to all incoming messages
  3. Sent a test message "Testando typebot" from my WhatsApp account
  4. My WhatsApp account has LID (Linked Identity Device) enabled, so the message was received with: - remoteJid: '28952559136882@lid' - remoteJidAlt: '[email protected]'

What did you expect?

  1. Typebot receives my message ✅
  2. Typebot processes the message and prepares a response ✅
  3. Typebot sends the response back to me using the correct JID format
  4. I receive the bot's response in my WhatsApp

What did you observe instead of what you expected?

  1. Typebot receives my message ✅
  2. Typebot processes the message ✅
  3. Typebot throws BadRequestException when trying to send the response ❌
  4. I never receive any response from the bot ❌
  5. The bot session gets stuck

The error: ERROR [unhandledRejection] { status: 400, error: 'Bad Request', message: [ { jid: '[email protected]', // ❌ Wrong! This doesn't exist exists: false, number: '28952559136882' } ] }

The problem: Typebot is trying to send to [email protected] (which doesn't exist) instead of 28952559136882@lid (the correct LID format) or [email protected] (my real phone number).

Root cause: In src/api/integrations/chatbot/base-chatbot.service.ts:293, the code does: number: remoteJid.split('@')[0] // Extracts '28952559136882'

Then sendMessageWithTyping() reconstructs it as [email protected] (invalid JID).

Screenshots/Videos

No response

Which version of the API are you using?

  • Evolution API: v2.3.6
  • Baileys: v7.0.0-rc.6

What is your environment?

Windows

Other environment specifications

  • Operating System: Linux (Docker)
  • Database: PostgreSQL
  • Affected Integration: Typebot
  • Also affects: OpenAI, Groq, Dify, N8n, Flowise, EvoAI (all chatbot integrations using base-chatbot.service.ts)

If applicable, paste the log output

[Evolution API] [Admin] v2.3.6 163 - Sat Oct 25 2025 11:02:14 VERBOSE [ChannelStartupService] [object] { key: { remoteJid: '28952559136882@lid', remoteJidAlt: '[email protected]', fromMe: false, id: 'ACABF8B1C8999990FF9B2926FF5491E3', participant: '', participantAlt: undefined, addressingMode: 'lid' }, pushName: 'RoNy MeLo', status: 'DELIVERY_ACK', message: { conversation: 'Testando typebot', messageContextInfo: { deviceListMetadata: [Object], deviceListMetadataVersion: 2, messageSecret: [Uint8Array] } }, messageType: 'conversation', messageTimestamp: 1761400934, instanceId: '21e60349-3a25-4306-952a-365d78f807cc', source: 'android' }

[Evolution API] v2.3.6 163 - Sat Oct 25 2025 11:02:14 VERBOSE [OnWhatsappCache] [string] Saving: [email protected], [email protected],[email protected],28952559136882@lid, lid=lid

[Evolution API] v2.3.6 163 - Sat Oct 25 2025 11:02:24 LOG [TypebotController] [string] Debounce complete. Processing message: Testando typebot [Evolution API] v2.3.6 163 - Sat Oct 25 2025 11:02:24 DEBUG [TypebotService] [string] [BaseChatbot] Sending single message [Evolution API] [Admin] v2.3.6 163 - Sat Oct 25 2025 11:02:25 VERBOSE [ChannelStartupService] [string] Checking 1 numbers via Baileys (not found in cache)

[Evolution API] v2.3.6 163 - Sat Oct 25 2025 11:02:25 ERROR [unhandledRejection] [object] { status: 400, error: 'Bad Request', message: [ { jid: '[email protected]', exists: false, number: '28952559136882', name: undefined, lid: undefined } ] }

Additional Notes

Context about LID

LID (Linked Identity Device) is WhatsApp's new addressing system. Users with LID have:

  • Primary JID: {LID_ID}@lid (e.g., 28952559136882@lid)
  • Alternative JID: {PHONE}@s.whatsapp.net (e.g., [email protected])

Current Evolution API behavior

  • ✅ Message receiving: Correctly handles LID
  • ✅ Cache system: Correctly stores both JID formats
  • ❌ Chatbot responses: Incorrectly reconstructs JID when sending

Proposed fix

Change src/api/integrations/chatbot/base-chatbot.service.ts:293:

// Current (wrong): number: remoteJid.split('@')[0]

// Proposed fix - Option 1: number: remoteJid // Keep full JID format

// Proposed fix - Option 2: number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0]

Impact

  • Severity: HIGH 🔴
  • Scope: All chatbot integrations
  • Frequency: 100% failure rate for LID users
  • Workaround: None

RelaxSolucoes avatar Oct 25 '25 14:10 RelaxSolucoes

Hi, I have the same problem

estebanlis avatar Oct 26 '25 00:10 estebanlis

I try to call send text message api with remotejid as number get 400 error.

But when test it with real number it worked.

https://doc.evolution-api.com/v2/api-reference/message-controller/send-text {"status":400,"error":"Bad Request","response":{"message":[{"exists":false,"jid":"83842157310076@lid","name":"my name","number":"83842157310076@lid"}]}}

mahdihaghnegar avatar Oct 26 '25 08:10 mahdihaghnegar

tambem estou com o mesmo problema ja temos alguma solução ?

antoniogsouzaag avatar Oct 26 '25 17:10 antoniogsouzaag

Realmente o typebot + evolution esta dando erro quando um numero que é @lid entra em contato. O bot não funciona

Por algum motivo ele tenta enviar a mensagem com @s.what........ ao inves de @lid o que ocasiona o erro.

Usando a rota sendtext de forma manual e colocando o @lid vai normalmente.

Aparentemente o erro esta apenas no chatbot service do typebot

willph avatar Oct 31 '25 02:10 willph

Same here

grupale avatar Nov 05 '25 18:11 grupale

Realmente o typebot + evolution esta dando erro quando um numero que é @lid entra em contato. O bot não funciona

Por algum motivo ele tenta enviar a mensagem com @s.what........ ao inves de @lid o que ocasiona o erro.

Usando a rota sendtext de forma manual e colocando o @lid vai normalmente.

Aparentemente o erro esta apenas no chatbot service do typebot

Como posso usar essa rota sendtext de forma manual? Estou tentando via N8n, até conseguir tratar para o numero correto, mas nao consigo fechar o fluxo no N8n enviando o comando de disparar o typebot.

isaqueipromotora avatar Nov 14 '25 12:11 isaqueipromotora

Use version 2.3.4

Brandevtech avatar Nov 14 '25 16:11 Brandevtech

Estou tendo o mesmo problema com contatos @lid , o bot nao responde. se alguem tiver uma solução me marca. to usando a 2.3.6

flavioxx avatar Nov 24 '25 01:11 flavioxx

na mesma situação.. se alguem tiver a solução por favor me fala..

menezesvitoria1502-art avatar Nov 24 '25 18:11 menezesvitoria1502-art

o mesmo por aqui 👎🏼

mpacheco92 avatar Nov 24 '25 19:11 mpacheco92

tbm estou com mesmo problema alguns numeros vem com @s.whatsapp.net e outros @lid

Jadsonps-dev avatar Nov 25 '25 15:11 Jadsonps-dev

2.3.4

I had the same issue. I downgraded to version v2.3.4 and the problem stopped happening. Thanks.

leonardomnds avatar Nov 27 '25 12:11 leonardomnds

Acredito que a solução seja usar outra API, só que paga, como por exemplo, UAZAPI.

isaqueipromotora avatar Nov 27 '25 14:11 isaqueipromotora

Eu tive que comprar uma versão alternativa da evo para voltar a funcionar. Porém ainda estou com o problema do stop from me. O bot não para quando o usuário digita, mas está enviando msgs para o @lid

carvalho7976 avatar Nov 27 '25 17:11 carvalho7976

Eu tive que comprar uma versão alternativa da evo para voltar a funcionar. Porém ainda estou com o problema do stop from me. O bot não para quando o usuário digita, mas está enviando msgs para o @lid

Qual alternativa está utilizando?

redequeroimoveis avatar Dec 02 '25 23:12 redequeroimoveis

Eu tive que comprar uma versão alternativa da evo para voltar a funcionar. Porém ainda estou com o problema do stop from me. O bot não para quando o usuário digita, mas está enviando msgs para o @lid

Qual alternativa está utilizando?

No grupo do discord da evo, procure o santosl2c

carvalho7976 avatar Dec 03 '25 00:12 carvalho7976