Click a button on a WhatsApp Business prompt (Baileys only)
POST/api/sessions/:sessionId/messages/click-button
Sends a structured button/list reply quoted to a previously received prompt. Not a native UI tap, so WhatsApp may reject it or treat it differently. Classic button/template/list prompts are supported; native-flow interactiveMessage replies are unverified. whatsapp-web.js returns 501. URL/call CTA buttons cannot be clicked this way. The prompt must still be in the engine store (a reloaded bubble can render choices from persisted metadata and then 404).
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 501
- 503
Button reply sent
Session not active, prompt is not clickable, buttonId is not among its choices, or recipient unreachable
The API key is missing, unknown, revoked, or expired
The API key's role, session or chat scope, or IP allow-list does not allow this operation
No such message: the id is outside the engine's lookup window (roughly the last hundred messages of the chat, or absent from the Baileys store) or the message was revoked.
The session is not connected: an engine exists for it but is not ready, meaning disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for ready and retry. A session that was never started answers 400 instead, and the session lifecycle routes answer 409 for a conflicting state rather than this. One window answers this while the session still reads ready: WhatsApp Web periodically reloads its own page and the engine re-injects into it, and for those few seconds the answer is a 409 naming the reload; retry shortly.
The active engine cannot serve this operation. It is part of the engine contract, but the engine currently running has no implementation for it.
Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure.