Create

Creates a filter

16 variables
15 variables

Creates a filter

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Manage your basic mail settings

Input

This building block consumes 16 input parameters

  = Parameter name
  = Format

userId STRING Required

User's email address. The special value "me" can be used to indicate the authenticated user

action OBJECT

A set of actions to perform on a message

action.addLabelIds[] STRING

action.forward STRING

Email address that the message should be forwarded to

action.removeLabelIds[] STRING

criteria OBJECT

Message matching criteria

criteria.excludeChats BOOLEAN

Whether the response should exclude chats

criteria.from STRING

The sender's display name or email address

criteria.hasAttachment BOOLEAN

Whether the message has any attachment

criteria.negatedQuery STRING

Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, "from:[email protected] rfc822msgid: is:unread"

criteria.query STRING

Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:[email protected] rfc822msgid: is:unread"

criteria.size INTEGER

The size of the entire RFC822 message in bytes, including all headers and attachments

criteria.sizeComparison ENUMERATION

How the message size in bytes should be in relation to the size field

criteria.subject STRING

Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed

criteria.to STRING

The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "[email protected]". This field is case-insensitive

id STRING

The server assigned ID of the filter

Output

This building block provides 15 output parameters

  = Parameter name
  = Format

action OBJECT

A set of actions to perform on a message

action.addLabelIds[] STRING

action.forward STRING

Email address that the message should be forwarded to

action.removeLabelIds[] STRING

criteria OBJECT

Message matching criteria

criteria.excludeChats BOOLEAN

Whether the response should exclude chats

criteria.from STRING

The sender's display name or email address

criteria.hasAttachment BOOLEAN

Whether the message has any attachment

criteria.negatedQuery STRING

Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, "from:[email protected] rfc822msgid: is:unread"

criteria.query STRING

Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:[email protected] rfc822msgid: is:unread"

criteria.size INTEGER

The size of the entire RFC822 message in bytes, including all headers and attachments

criteria.sizeComparison ENUMERATION

How the message size in bytes should be in relation to the size field

criteria.subject STRING

Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed

criteria.to STRING

The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "[email protected]". This field is case-insensitive

id STRING

The server assigned ID of the filter