Skip to main content
GET
Mail rules are per-identity allow/block lists that control which emails reach an agent’s inbox (inbound), which addresses it may send to (outbound), replies on existing threads (reply), or both. A rule’s entry is either an exact email address (alex@example.com) or a domain (example.com). Rules take precedence over the baseline filter modes. For an inbound message, Wirebox evaluates:
  1. Exact-email rule (match_type: exact_email)
  2. Domain rule (match_type: domain)
  3. Reply on an existing outbound thread (reply direction rules)
  4. Baseline inbound filter mode

Rule Object

string
Unique rule identifier (mrl_ prefix).
string
Identity the rule belongs to.
string
inbound, outbound, reply, or both.
string
allow or block.
string
Normalized match target (email address or domain).
string
exact_email for addresses, domain for domains.
string
Same value as entry; kept for API symmetry.
string | null
Optional audit note describing why the rule exists.
string
active or paused.
string
ISO 8601 creation timestamp.
string
ISO 8601 update timestamp.

List Rules

Path Parameters

string
required
The agent handle (e.g. eva).

Query Parameters

string
Filter by direction: inbound, outbound, or both. Rules with direction both are included when filtering for a specific direction.
The response also carries the identity’s current baseline filter_modes:

Create Rule

Body Parameters

string
required
Email address or domain to match. Contains @ → treated as an exact address; otherwise treated as a domain (a leading @ or *@ is stripped).
string
required
allow or block.
string
default:"both"
inbound, outbound, reply, or both.
string
Optional audit note.
Returns 201 with the created Rule Object. Creating a duplicate rule for the same target and direction is rejected with 409.

Get, Update & Delete a Rule

GET /identities/{agent_handle}/mail-rules/{rule_id} returns a single Rule Object. PATCH accepts any of direction, action, status (active or paused), and reason, and returns the updated rule:
cURL
DELETE /identities/{agent_handle}/mail-rules/{rule_id} removes the rule and returns 204 No Content:
cURL
CLI

Filter Modes (Policy)

Every identity also has a baseline posture for each direction, stored as mail_inbound_filter_mode and mail_outbound_filter_mode (see Update Agent Identity): The SDKs expose the same settings with friendlier names: protected (= whitelist) or open (= blacklist) for inbound, and restricted (= whitelist) or open (= blacklist) for outbound.