Pin or unpin a chat at the top of the chat list
POST/api/sessions/:sessionId/chats/pin
Pin or unpin a chat at the top of the chat list
Request
Responses
- 200
- 400
- 404
- 409
- 503
Returns { success }. false means the engine declined, and only a pin can: WhatsApp allows at most three pinned chats and the whatsapp-web.js engine reports the refusal. Unpinning always succeeds, and the Baileys engine always reports success because it cannot observe the cap.
Session not ready, or a chatId the session cannot resolve. An unknown chat is reported here rather than as success: false, which on this route means only that the three-pin cap refused a real chat. The Baileys engine cannot resolve chats ahead of the write and answers success: true for an unknown chat.
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.
WhatsApp did not answer within the request budget. The change may or may not have been applied — the gateway stopped waiting for a confirmation that never came.