Skip to main content

Find emails

Find Gmail messages with a Gmail search such as from:billing@acme.com is:unread and return them as a table.

Command in the Google Workspace toolkit · id ooa.google/gmail_list_messages · 14 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Access tokenCredentialYesGoogle OAuth access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token.
QueryStringNoGmail search text; all messages when empty.
Maximum resultsNumberNo100Maximum messages returned.
Include spam trashBooleanNofalseAlso search Spam and Trash.
From containsStringNoSender contains this text; separate several with ; to match any of them.
Subject containsStringNoSubject contains these words; separate several with ; to match any of them.
SinceDateTimeNoReceived on or after this time (UTC).
BeforeDateTimeNoReceived before this time (UTC).
StatusStringNoanyOnly unread or only read messages.
LabelStringNoOnly messages with this label, e.g. INBOX or Invoices.
Has attachments onlyBooleanNofalseOnly messages with attachments.
Endpoint addressStringNoReplaces https://*.googleapis.com for testing or a proxy; leave empty normally.
Oldest firstBooleanNofalseThe oldest messages first (G5).
Local timeBooleanNofalsereceived in the runner's time zone instead of UTC (G5).

Outputs​

OutputTypeWhat it is
tableTableColumns: id, thread_id, from, to, subject, date, snippet, unread, labels, received (date and time, UTC).
countNumberNumber of messages.