Summary
Create a rule. Conditions are AND and case-insensitive: from (email, @domain, or domain), to, subject_contains, body_contains, has_attachment, auth pass|fail (DMARC), and list. Actions: add_labels, folder (inbox, archive, spam, trash), mark_read, forward_to, and auto_reply. stop_processing ends later rules. At most 20 rules (409 rule_limit). client_id returns the original rule. forward_to must be another inbox on this account or a verified owner (400 forward_target_not_allowed). A bad body is 400 invalid_rule. Write permission is message_update.
Request
{
"name": "Archive newsletters",
"conditions": {
"list": true
},
"actions": {
"folder": "archive"
},
"stop_processing": true
}Response
The OpenAPI document does not declare a JSON response schema for this call. The summary is the contract.Errors
- HTTP 409 rule_limit
- HTTP 400 forward_target_not_allowed
- HTTP 400 invalid_rule
Idempotency
client_id makes this write idempotent. Sending the same client_id again returns the original object instead of creating a duplicate.