App Logo
mail.google.com

Report Gmail thread as spam

Automatically report Gmail thread as spam on mail.google.com. Report a Gmail thread as spam by its hex threadId, as returned by search_emails, so it moves to the Spam folder. Returns reportedSpam and threadId only once the thread is confirmed in Spam. A thread already in Spam or in the Bin, or an id Gmail cannot open, is refused with nothing changed. Reporting also teaches Gmail's spam filter about that sender, which moving the thread back does not fully undo. Pass account when several Google accounts share the browser. For senders with an unsubscribe link Gmail asks whether to report or unsubscribe; the script never answers that question for you: it closes it and fails with nothing reported, so such mail must be reported by hand.

Input

threadId required

Hex thread id, from the threadId field of mail.google.com/search_emails (list_inbox does not return thread ids).

account optional

Google account to act as: its email address, or a bare mailbox index such as "2". An address not signed in to this browser is refused with nothing reported. Omit for the first account (u/0).

Output

page required

Always 1: the thread is found with a search for its subject, not by paging All Mail. Kept for compatibility.

threadId required
reportedSpam required

FAQ

Report a Gmail thread as spam by its hex threadId, as returned by search_emails, so it moves to the Spam folder. Returns reportedSpam and threadId only once the thread is confirmed in Spam. A thread already in Spam or in the Bin, or an id Gmail cannot open, is refused with nothing changed. Reporting also teaches Gmail's spam filter about that sender, which moving the thread back does not fully undo. Pass account when several Google accounts share the browser. For senders with an unsubscribe link Gmail asks whether to report or unsubscribe; the script never answers that question for you: it closes it and fails with nothing reported, so such mail must be reported by hand.
Ask an AI agent connected to Reduck to run reduck/mail.google.com/report_spam, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/mail.google.com/report_spam
You do not need one. "Report Gmail thread as spam" drives the real mail.google.com pages in a browser, so it works whether or not mail.google.com offers an API for this.
Required: threadId. Optional: account.
It returns page, threadId, reportedSpam.
Yes. It acts as you on mail.google.com: on your own Chrome it reuses your session, and on a Reduck-hosted browser it loads the mail.google.com cookies saved by the Reduck extension.
It makes changes on mail.google.com, like sending, posting, booking or buying something.
Ask an AI agent connected to Reduck to run reduck/mail.google.com/report_spam, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/mail.google.com/report_spam
It is part of Reduck's official curated catalogue.

Start building not clicking