Preview applying folder rules (beta)
preview_rulesPreview which INBOX messages saved folder rules would move, with per-rule counts and skipped senders. Get a single-use approval token for a batch without changing mail.
Instructions
Beta: Preview which INBOX mail the folder rules would move now, skipping protected senders, and return a single-use token for one batch; changes no mail.
The rules engine is not fully reliable yet; preview first and check the results.
Use it when the user asks to apply the folder rules, which list_rules shows; it is for manual use only. Show per-rule counts, samples and skipped senders, wait for the user's explicit approval, then call apply_rules with the token. Use preview_action for a one-off change. It does not edit Proton's own filters.
A token covers one batch of up to limit reviewed matches; remaining counts what is left, and further batches need separate approval. Saved rules (add_rule) follow the packaged ones and report their name, conditions, match and mark_read; a saved rule with mark_read=true marks its own matches read. A message with inconsistent sender copies or ambiguous label memberships is left out of the batch and token and reported in excluded_count, excluded_ids, excluded_truncated and excluded_reasons; total_matches counts it, remaining does not. All excluded means no token.
The call budget is 20 seconds (or the shorter configured budget). When reviews are slow, a call may review one whole batch of a single rule, so each rule needs its own approval and order holds only within a rule; a deadline without a complete batch returns partial=true and no token. Pass next_cursor as cursor with the same options to continue. A call that fails keeps the cursor it was given, so retry with it; a reply spends it. Cursors expire after ten minutes or restart and never authorize changes.
Returns per-rule counts and samples, total_matches, batch_count, remaining, partial, total_is_exact, reason, token, expires_at, action_hash, next_cursor and excluded_*. Other refusals end the call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Reviewed matches this batch's token may cover, 1 to 200. | |
| order | No | Which matches come first, by INTERNALDATE then UID. | oldest |
| cursor | No | next_cursor from the previous call, with the same options. A reply spends it and it lasts ten minutes; if it came back null, start a fresh preview. | |
| folder | No | Only INBOX is accepted; any other folder is blocked, with no token. | INBOX |
| mark_read | No | Also mark the moved messages read. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||