원클릭으로
gws-gmail-users-settings-filters-create
Gmail: Create a server-side message filter (rule) that auto-labels matching mail.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Gmail: Create a server-side message filter (rule) that auto-labels matching mail.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Gmail: Create a custom label in the user's mailbox.
Gmail: List all labels in the user's mailbox.
Gmail: Get a specific message by ID with configurable format.
Gmail: List messages in a user's mailbox with optional filtering.
Gmail: Modify the labels applied to a specific message.
Gmail: List the existing message filters (rules) in the user's mailbox.
| name | gws-gmail-users-settings-filters-create |
| description | Gmail: Create a server-side message filter (rule) that auto-labels matching mail. |
Create a persistent server-side filter. Gmail applies it automatically to matching future mail (and offers to apply to existing matches in the UI). A mailbox can hold at most 1,000 filters.
⚠️ Filters are persistent and silent. Validate with
--dry-runfirst, and prefer label-only actions (addLabelIds) — never auto-archive (removeLabelIds: ["INBOX"]), delete (["TRASH"]), or mark read without explicit user intent.
gws gmail users settings filters create --params '<JSON_PARAMS>' --json '<JSON_BODY>'
--params JSON)| Parameter | Required | Description |
|---|---|---|
userId | ✓ | The user's email address or "me" for the authenticated user |
--json JSON){
"criteria": { "from": "notifications@github.com" },
"action": { "addLabelIds": ["Label_42"] }
}
criteria fields (match conditions — combine with AND)| Field | Type | Description |
|---|---|---|
from | String | Sender. Supports *@domain.com and domain.com. |
to | String | Recipient. |
subject | String | Subject contains. |
query | String | Any Gmail search query (e.g. "list:newsletters"). |
negatedQuery | String | Gmail search query that must NOT match. |
hasAttachment | Boolean | Only messages with attachments. |
action fields| Field | Type | Description |
|---|---|---|
addLabelIds | [String] | Label IDs (not names) to apply. Use labels list. |
removeLabelIds | [String] | Label IDs to remove. Avoid for auto-curation. |
forward | String | Forwarding address. Do not use for auto-curation. |
# Validate locally first — does not call the API
gws gmail users settings filters create --params '{"userId": "me"}' \
--json '{"criteria": {"from": "notifications@github.com"}, "action": {"addLabelIds": ["Label_42"]}}' --dry-run
# Create the filter
gws gmail users settings filters create --params '{"userId": "me"}' \
--json '{"criteria": {"from": "notifications@github.com"}, "action": {"addLabelIds": ["Label_42"]}}'
addLabelIds takes label IDs, not display names. Resolve them with
gws gmail users labels list and match on the name field.from, or *@domain.com only when the whole domain is consistent).