Skip to content

Google: Gmail users settings filters schemas

6 Google schemas with complete fields and constraints.

← Gmail users settings filters operations · All schemas

Creates a filter. Note: you can only create a maximum of 1,000 filters For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — request body — body

FieldTypePresenceDescription and constraints
$objectRootResource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
actionModelOptionalExpand Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — action
Action that the filter performs.
criteriaModelOptionalExpand Creates a filter. Note: you can only create a maximum of 1,000 filters For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — request body — body criteria
Matching criteria for the filter.
idstringOptionalThe server assigned ID of the filter.

Referenced models: Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — action, Creates a filter. Note: you can only create a maximum of 1,000 filters For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — request body — body criteria

Creates a filter. Note: you can only create a maximum of 1,000 filters For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — request body — body criteria

FieldTypePresenceDescription and constraints
$objectRootMessage matching criteria.
excludeChatsbooleanOptionalWhether the response should exclude chats.
fromstringOptionalThe sender's display name or email address.
hasAttachmentbooleanOptionalWhether the message has any attachment.
negatedQuerystringOptionalOnly return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.
querystringOptionalOnly return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.
sizeintegerOptionalThe size of the entire RFC822 message in bytes, including all headers and attachments.
Format: int32
sizeComparisonstringOptionalHow the message size in bytes should be in relation to the size field.
One of: unspecified, smaller, larger
subjectstringOptionalCase-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
tostringOptionalThe 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 "example@example.com". This field is case-insensitive.

Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body

FieldTypePresenceDescription and constraints
$objectRootResource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
actionModelOptionalExpand Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — action
Action that the filter performs.
criteriaModelOptionalExpand Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — criteria
Matching criteria for the filter.
idstringOptionalThe server assigned ID of the filter.

Referenced models: Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — action, Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — criteria

Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — action

FieldTypePresenceDescription and constraints
$objectRootA set of actions to perform on a message.
addLabelIdsarrayOptionalList of labels to add to the message.
addLabelIds[]stringEach item
forwardstringOptionalEmail address that the message should be forwarded to. This effectively redirects the message to the address specified in this field, maintaining the original sender in the "From" field.
removeLabelIdsarrayOptionalList of labels to remove from the message.
removeLabelIds[]stringEach item

Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body — criteria

FieldTypePresenceDescription and constraints
$objectRootMessage matching criteria.
excludeChatsbooleanOptionalWhether the response should exclude chats.
fromstringOptionalThe sender's display name or email address.
hasAttachmentbooleanOptionalWhether the message has any attachment.
negatedQuerystringOptionalOnly return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.
querystringOptionalOnly return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.
sizeJSONOptional
size (anyOf 1)integerAlternativeThe size of the entire RFC822 message in bytes, including all headers and attachments.
Format: int32
size (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
sizeComparisonstringOptionalHow the message size in bytes should be in relation to the size field.
Known values: unspecified, smaller, larger
subjectstringOptionalCase-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
tostringOptionalThe 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 "example@example.com". This field is case-insensitive.

Lists the message filters of a Gmail user For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body

FieldTypePresenceDescription and constraints
$objectRootResponse for the ListFilters method.
filterarrayOptionalList of a user's filters.
filter[]ModelEach itemExpand Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body

Referenced models: Gets a filter For more information, see Manage Gmail filters (https: developers google com workspace gmail api guides filter settings) — response body

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.