App Logo
mail.google.com

Report Gmail thread as spam

Report a Gmail thread as spam by its hex threadId (moves it to Spam). Requires an authenticated mail.google.com session. Works from the All Mail list view and is locale-independent. Returns reportedSpam, threadId. Moving the thread to Spam also feeds Gmail's spam classifier for that sender, which undoing does not fully reverse. Pass `account` (authuser=) in a multi-account browser jar, or Gmail picks u/0 nondeterministically. The thread must be on the first page of All Mail (newest-first) — the script does not paginate, so an older thread will not be found. Senders with an unsubscribe link raise an extra "Report spam or unsubscribe?" dialog; the script confirms the spam branch and rejects the unsubscribe one, and throws rather than guessing on an unrecognised dialog shape.

Input

threadId required

Hex legacy thread id (as returned by search_emails).

account optional

Google account email to act as (authuser=). Without it Gmail picks u/0, nondeterministic in a multi-account browser jar.

Output

threadId required
reportedSpam required

Start building not clicking