Subscribe to a chat's presence
POST/api/sessions/:sessionId/presence/subscribe
Asks WhatsApp to start reporting who is online or typing in this chat. Updates arrive as the presence.update webhook and socket event — there is no synchronous answer, because presence cannot be queried from either engine, only received.
The subscription belongs to the connection: it does not survive a restart or an automatic reconnect, and must be re-issued. Subscribe per chat rather than to everything — WhatsApp emits an update on every transition, so a broad subscription is a firehose.
whatsapp-web.js cannot do this at all (it exposes no presence subscribe and emits no presence event) and answers 501.
Request
Responses
- 200
- 400
- 404
- 409
- 501
Subscribed; updates now arrive as presence.update events
Session not started
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.
The active engine cannot observe presence (whatsapp-web.js)