Skip to main content
gmail.markMessagesAsSpam adds SPAM and removes INBOX in one request.

Example

Move newly received messages with a known unwanted subject marker to Spam:

Inputs

Inputs accept compatible signals.

Output

Returns a Signal<string[]> with the modified message IDs in input order. This action requests both state changes together: add SPAM and remove INBOX. It doesn’t delete the messages or remove unrelated labels. Use gmail.markMessagesAsNotSpam to reverse these two mailbox changes.