Skip to main content
Version: v0.31.0

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.

A successful call is remembered for the life of the running engine and re-applied once each time that connection opens, including a Baileys transient reconnect: the socket announces itself on connect (available unless BAILEYS_MARK_ONLINE_ON_CONNECT=false), which would otherwise replace the caller's choice. The preference is dropped whenever the gateway replaces the engine: stop, restart, reconnect recovery, a watchdog recycle, or a takeover by another node. Re-issue it after session.status reports ready again. On Baileys, typing, recording and outbound sends do not publish global presence.

On Baileys the call fails with 409 when the account push name has not synced yet — the library would otherwise accept the request and send nothing. Supported on both engines.

Request​

Responses​

Presence published