Skip to main content
Archives up to 50 messages in one call: each is removed from the Inbox and added to the Archive mailbox. Read state is untouched, and any other folder a message is in — Sent, for your own reply in a thread — is left alone. Re-running it on the same ids is harmless. To file into a specific folder use move_emails; to delete use trash_emails. Nothing is created: an account without an Archive mailbox gets an error, not a new folder.

Parameters

string[]
required
1–50 message ids, as returned by search_emails or get_thread. Duplicates are collapsed. To archive a whole conversation, pass every id get_thread lists.

Example

Call
Result
A batch is not all-or-nothing. Ids the server refused are listed with the reason, and the call only counts as an error when nothing was archived:
Result — one stale id

Errors

  • This account has no Archive mailbox. Nothing was archived. … — create one in the mail client, or use move_emails with an existing folder.
  • Archived 0 message(s). Not updated (N): … Re-run search_emails or get_thread for current ids. — every id was refused, typically because the messages no longer exist.