gmail.users.settings.filters.create
Create Gmail filters that match messages by criteria and apply actions like labeling or forwarding. Use it to automate inbox organization, up to 1,000 filters per account.
Instructions
Creates a filter. Note: you can only create a maximum of 1,000 filters. For more information, see Manage Gmail filters [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON Filter object accepting action, criteria, id; pass it via params or whole via body_file Siblings over the same resource: delete, get, list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Extra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe. | |
| params | No | Parameter map merged into the request; typed parameters win. | |
| userId | Yes | [URL path segment] User's email address. The special value "me" can be used to indicate the authenticated user. | me |
| dry_run | No | Return the request that would be sent, without sending it. | |
| body_file | No | Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Filter object. | |
| request_body | No | Request body of type Filter: pass it via `params` (merged into the built body) or whole via `body_file`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| action | No | ||
| criteria | No |