Edit the text of a message sent by this account
POST/api/sessions/:sessionId/messages/edit
Edit the text of a message sent by this account
Request
Responses
- 200
- 400
- 403
- 404
- 409
- 503
Message edited
Session not active, invalid request, or the send was blocked by a plugin
The engine refused the edit. The Baileys adapter refuses a message the account did not send; whatsapp-web.js reads the refusal from the page, which also covers a message that is not text. Past its own guard the Baileys engine has no acceptance signal and answers 200.
Message not found
The session is not connected — an engine exists for it but is not ready: 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 — for those few seconds the answer is a 409 naming the reload; retry shortly.
The whatsapp-web.js page connection died mid-request. The change may or may not have been applied; repeating the request is safe, since it converges on the same state.