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
- 401
- 403
- 404
- 409
- 503
Message edited
Session not active, invalid request, or the send was blocked by a plugin
The API key is missing, unknown, revoked, or expired
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. Also returned when the API key's role, session or chat scope, or IP allow-list does not allow this operation.
Message not found
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.
Baileys could not complete the recipient lookup within the request budget. On send routes, no message was handed to WhatsApp for this lookup failure. 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.