mail_undo_bulk_action
Regret a bulk cleanup? Reverse it within 30 days using the action_id from the original run: moved, archived, or trashed messages return to their folders; marked-read ones become unread.
Instructions
Reverse one earlier mail_run_bulk_action run by its action_id: moved, archived or trashed messages go back to their folder, and messages it marked read become unread.
Use when: the owner regrets a bulk cleanup made within the last 30 days. Not for single moves or deletions (use mail_move_messages to bring messages back from their folder or Trash), or for marking specific messages (use mail_mark_messages). Parameters: action_id is the 12-character hex string from the mail_run_bulk_action result (its undo field repeats it), copied exactly; it is not a uid or a confirm_token. Only runs made on this server within 30 days are found: an unknown, mistyped or expired id returns undone=false with a reason and changes nothing, so check the id rather than retrying. Behavior:
Messages are found again by Message-ID in the folder the run left them in (the original folder for mark_read) and handled in chunks.
Any moved or deleted since the run are skipped.
Undoing mark_read marks every handled message unread, including ones that were already read before the run.
Each run can be undone once, and the undo is logged. Returns: {undone: true, restored, of, note when some were skipped}, or {undone: false, reason} when the id is unknown, already undone, or older than 30 days. Errors: 'Could not open the folder' when that folder was renamed or deleted since; the messages then have to be found with mail_search_messages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action_id | Yes | The action_id returned by mail_run_bulk_action. |