Move Email to Custom Folder
move_to_folderMove an email to a custom folder by specifying its ID and folder name. Include the source folder to ensure accurate targeting and prevent silent no-ops.
Instructions
Move an email to a custom folder (Folders/). Similar to move_to_label but for Folders/ paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | Yes | Folder name without prefix (e.g. Work). Moves to Folders/Work. | |
| emailId | Yes | ||
| account_id | No | Optional account ID to route this call to (multi-account configs). Omit to use the active account. Configured account IDs are listed in the settings UI (Accounts tab). | |
| sourceFolder | No | Folder the UID(s) live in (e.g. INBOX, Folders/Work, Labels/Foo). Strongly recommended whenever the UIDs came from a folder other than INBOX — IMAP UIDs are folder-scoped, so without this the wrong folder may be selected and the operation may silently no-op. Avoid passing 'All Mail' as the source: it is a union view of every folder, not a real location, so moves out of it can silently do nothing — pass the message's actual folder instead. Moving to the folder a message is already in is a no-op. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | ||
| success | Yes | ||
| messageId | No |