Skip to main content

Watch a folder for new mail

POST 

/api/accounts/:accountId/idle-folder

Starts live updates for one folder of the account, usually the one the user is viewing, and returns { "ok": true, "folder": ... }. The server keeps an IMAP IDLE connection on the folder and reports new messages, expunges and flag changes as events on GET /api/events.

Each account has one watched folder, so this replaces the previous one; calling it again for the same folder keeps the existing connection. The response confirms which folder is actually being watched; if the watch could not be established, the request fails so the client can retry. Watches stop a few seconds after the user's last event stream closes.

Request​

Responses​

Watching the folder.