# organize_mail

> Organize a mailbox: move messages between folders, mark read/unread, star/unstar (`flag`/`unflag`), move to Trash (`trash`), and create or delete folders.

- Tier: W
- Required scope: contents:email + read:email
- Annotations: none
- Docs: https://api.inleed.com/tools/organize-mail

## Description

Organize a mailbox: move messages between folders, mark read/unread, star/unstar (`flag`/`unflag`), move to Trash (`trash`), and create or delete folders. Writes need the `write:email` scope. `trash` only moves to the Trash folder — nothing here permanently deletes a message, and `delete_folder` refuses system folders and non-empty folders. Every action answers with the folders' read-back counters as proof.

## Input schema

- `address` — string (required). The full mailbox address, e.g. info@example.com.
- `action` — enum (required). move needs destination; move/trash/mark_*/flag/unflag need uids; create_folder/delete_folder need folder only. One of move, mark_read, mark_unread, flag, unflag, trash, create_folder, delete_folder.
- `folder` — string. The folder the messages are in (default inbox) — or, for create_folder/delete_folder, the folder to create/delete.
- `destination` — string. For move: the folder to move the messages into, from list_mail_folders.
- `uids` — string. The message uids to act on, from search_mail — a comma list (3,7,9) or range (1:20).

## Example call

```json
{
  "name": "organize_mail",
  "arguments": {
    "address": "info@example.se",
    "action": "move"
  }
}
```

