Add a receive rule
POST
/v1/email/mailboxes/{mailbox_id}/receive-rules
curl -X POST "https://us1.platform.bird.com/v1/email/mailboxes/{mailbox_id}/receive-rules" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "block",
"entry": "spammy.example.com"
}'Adds an allow or block rule to the mailbox. Rules match the message's envelope sender; domain entries also match subdomains. Block rules always win — over allow rules and over the reply admission on allowlist mailboxes. An entry can be allow or block, never both: to flip it, delete the rule and re-create it. A mailbox holds up to 200 rules.
Request Payload
action
string
required
What the rule does when it matches. Block rules always win. To flip an entry's action, delete the existing rule and re-create it.
entry
string
required
The sender address (alice@example.com) or domain (example.com) to match. Domains also match their subdomains. Stored lowercase.
note
string
Your own note about why the rule exists.
Response Payload
id
string
required
Receive rule ID.
mailbox_id
string
required
The mailbox the rule applies to.
action
string
required
What the rule does when it matches. Block rules always win — over allow rules and over the reply admission on allowlist mailboxes.
entry
string
required
The sender address or domain the rule matches. Domains also match their subdomains.
entry_type
string
required
Whether the entry is a full address or a domain.
note
nullable string
required
Your own note about why the rule exists. Null when unset.
created_at
string
required
When the rule was created.