Set the account's own global presence (appear online or offline)
PUT/api/sessions/:sessionId/presence
Publishes whether this account appears online. WhatsApp routes notifications away from the phone while a linked device announces itself online, so a headless bot that never goes offline suppresses the phone's own alerts — set available: false to hand them back.
The setting belongs to the connection: it does not survive a restart or reconnect and must be re-issued after session.status reports one (on Baileys the socket re-announces itself per its connect-time behaviour). Supported on both engines.
Request
Responses
- 200
- 400
- 404
- 409
Presence published
Session not started, or validation failed
Session 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.