Move all emails
Add and remove labels on every Gmail message that matches a search or the filters, e.g. move them from INBOX to Processed.
Command in the Google Workspace toolkit · id ooa.google/gmail_move_all · 13 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Access token | Credential | Yes | Google OAuth access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token. | |
| Add labels | Any | No | Label name(s) or id(s) to add. | |
| Remove labels | Any | No | INBOX | Label name(s) or id(s) to remove; INBOX by default. |
| Query | String | No | Gmail search selecting the messages. | |
| From contains | String | No | Sender contains this text; separate several with ; to match any of them. | |
| Subject contains | String | No | Subject contains these words; separate several with ; to match any of them. | |
| Since | DateTime | No | Received on or after this time (UTC). | |
| Before | DateTime | No | Received before this time (UTC). | |
| Status | String | No | any | Only unread or only read messages. |
| Label | String | No | Only messages with this label, e.g. INBOX or Invoices; several separated by ; (G5). | |
| Maximum messages | Number | No | 500 | Upper limit of messages handled in one run; 0 for no limit (G5). |
| Endpoint address | String | No | Replaces https://*.googleapis.com for testing or a proxy; leave empty normally. | |
| Keep other labels | Boolean | No | true | Keep the messages' other labels; off removes every label of your own except the ones added (G5). |
Outputs
| Output | Type | What it is |
|---|---|---|
| count | Number | Number of messages changed. |