Skip to content
Inkbox

Inkbox

BlogContactDocs
GuidesAPI Reference

Ctrl K

GuidesAPI Reference

Jump to

Mailbox Contact Rules

Per-mailbox allow/block rules for inbound email. The mailbox's filter_mode field decides how the rule list is interpreted:

  • filter_mode: "whitelist" — only senders matching an allow rule can deliver mail
  • filter_mode: "blacklist" — every sender can deliver except those matching a block rule

Set filter_mode on the mailbox itself via PATCH /mailboxes/{email_address} — see Mailboxes. The rules below are interpreted against that mode.

Rules match on either a full email address (match_type: "exact_email") or a bare domain (match_type: "domain"). A rule with status: "paused" reserves the target slot without taking effect, so you can stage policy changes without losing the uniqueness claim.

Auth. List, get, and create accept admin API keys, claimed agent keys, and Clerk JWT; unclaimed (mid-signup) agent keys are rejected. PATCH, DELETE, and the org-wide list are admin + JWT only.

For the org-wide audit view, see List org mail contact rules.


List contact rules GET

GET /mailboxes/{email_address}/contact-rules

List contact rules for a mailbox, newest first. Returns both active and paused rules.

Path parameters

ParameterTypeDescription
email_addressstringMailbox email address

Query parameters

ParameterTypeDefaultDescription
actionstringFilter by "allow" or "block"
match_typestringFilter by "exact_email" or "domain"
limitinteger50Max rules (1–200)
offsetinteger0Offset for pagination

Response (200)

JSONJSON

Code examples


Create contact rule POST

POST /mailboxes/{email_address}/contact-rules

Create an allow or block rule on a mailbox.

Path parameters

ParameterTypeDescription
email_addressstringMailbox email address

Request body

FieldTypeRequiredDescription
actionstringYes"allow" or "block"
match_typestringYes"exact_email" (full address) or "domain" (bare domain like gmail.com)
match_targetstringYesValue to match against. For exact_email: a full address with one @ and at least one dot after it. For domain: a lowercase ASCII bare domain (no leading *@, no leading @, no trailing .). Max 320 chars.

New rules always start with status: "active" — to pause a rule use Update contact rule.

Request example

JSONJSON

Response (201)

Returns the created rule.

Error responses

StatusDescription
409A non-deleted rule with the same (match_type, match_target) already exists. Response body contains existing_rule_id.
422match_target invalid for the given match_type (e.g. glob pattern, non-ASCII domain, missing dot)

Code examples


Get contact rule GET

GET /mailboxes/{email_address}/contact-rules/{rule_id}

Fetch a single contact rule by ID.

Path parameters

ParameterTypeDescription
email_addressstringMailbox email address
rule_idUUIDRule ID

Code examples


Update contact rule PATCH

PATCH /mailboxes/{email_address}/contact-rules/{rule_id}

Update a rule's action or status.

Auth: admin API key or Clerk JWT only.

match_type and match_target are immutable — delete the rule and create a new one to change the target.

Path parameters

ParameterTypeDescription
email_addressstringMailbox email address
rule_idUUIDRule ID

Request body

At least one of:

FieldTypeDescription
actionstring"allow" or "block"
statusstring"active" or "paused" (only these two values are accepted on PATCH; use DELETE to remove a rule)

Sending null for either field is a client error (422) — omit the field to leave it unchanged.

Code examples


Delete contact rule DELETE

DELETE /mailboxes/{email_address}/contact-rules/{rule_id}

Delete a contact rule. Returns 204 No Content on success.

Auth: admin API key or Clerk JWT only.

Path parameters

ParameterTypeDescription
email_addressstringMailbox email address
rule_idUUIDRule ID

Code examples


List org mail contact rules GET

GET /mail/contact-rules

Org-wide aggregate list of mail contact rules across every mailbox the caller can see. Intended for admin dashboards that render rules org-wide without fanning out one per-mailbox request per mailbox.

Auth: admin API key or Clerk JWT only.

Results are ordered created_at descending, with id as a stable tiebreaker so pagination stays consistent when rules from different mailboxes share a microsecond.

Query parameters

ParameterTypeDefaultDescription
mailbox_idUUIDNarrow to a single mailbox; omit to list across every mailbox in the org
actionstringFilter by "allow" or "block"
match_typestringFilter by "exact_email" or "domain"
limitinteger50Max rules (1–200)
offsetinteger0Offset for pagination

Response (200)

Returns an array of contact rule objects — same shape as the per-mailbox list.

Code examples


Contact rule object

FieldTypeDescription
idUUIDUnique rule identifier
mailbox_idUUIDOwning mailbox
actionstring"allow" or "block"
match_typestring"exact_email" or "domain"
match_targetstringCanonicalized match value
statusstring"active", "paused", or "deleted"
created_atstringCreation timestamp (ISO 8601)
updated_atstringLast-updated timestamp (ISO 8601)

Additional resources

  • Filtering guide — narrative walk-through of whitelist/blacklist semantics across mail and phone
  • Mailboxes — includes the filter_mode field that interprets these rules
  • Phone contact rules — the phone-side equivalent

Inkbox

Copyright © 2026 Inkbox

This site is protected by reCAPTCHA.

Google Privacy Policy and Terms of Service apply.

Website

Inkbox

Copyright © 2026 Inkbox

This site is protected by reCAPTCHA.

Google Privacy Policy and Terms of Service apply.

Website

Mailbox Contact Rules