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
- 200
- 400
- 401
- 404
- 503
Watching the folder.
Request failed.
The session has no mailbox access token. code is mail_token_missing; sign in again.
The account does not exist or belongs to another user.
The folder watch could not be established; the client may retry.