Skip to main content
trash moves one or many Gmail messages to Trash using Gmail’s dedicated trash operation. Use it when messages should leave the mailbox’s active views but still be recoverable for as long as Gmail retains them.

Example

Trash newly received messages with a known test marker:

Inputs

Every input field also accepts a compatible Signal; the example passes the filtered message ID signal directly.

Output

The action returns a Signal<Array<{ messageId: string; threadId: string; historyId?: string; labelIds: string[] }>> with Gmail’s updated metadata for every message, in input order.
Trashing is not permanent deletion, but Gmail can permanently delete retained Trash contents. untrash can restore a message only while Gmail still has it.
The action operates on individual message IDs. Trashing one message does not explicitly trash every message in its thread.