Skip to main content
Version: v0.23.1

Log out of WhatsApp (unlinks this device) and stop the session

POST 

/api/sessions/:sessionId/logout

Attempts an engine-native unlink of this companion device, then tears the session down locally. 200 means the engine-native unlink operation completed AND the required local credential cleanup completed — for Baileys a valid companion identity, an acknowledged remove-companion-device IQ response, and removal of the on-disk auth dir; for whatsapp-web.js the native Client.logout() promise settled. 200 is NOT an independent observation that the handset UI no longer shows the linked device. Because a completed unlink wipes the stored credentials, reconnecting after a 200 always requires a fresh QR scan or pairing code.

Request

Responses

Unlink operation and required local cleanup completed; session is stopped and phone is cleared. Recorded in the audit log as session_logged_out.