Configure inbound email firewall rules to allowlist trusted senders or reject unwanted addresses, full domains, and wildcard patterns at the network edge.
Quick Reference #
Endpoint Method Required Scope Description /v1/sender-rules/whitelistGETsender_rules:readList configured allowed sender rules. /v1/sender-rules/whitelistPOSTsender_rules:writeCreate an allowlist rule for an address, domain, or pattern. /v1/sender-rules/whitelistPATCHsender_rules:writeToggle or update an allowlist rule. /v1/sender-rules/whitelistDELETEsender_rules:writeDelete an allowlist rule. /v1/sender-rules/whitelist/statsGETsender_rules:readRetrieve allowlist volume and monthly trend metrics. /v1/sender-rules/blacklistGETsender_rules:readList configured blocked sender rules. /v1/sender-rules/blacklistPOSTsender_rules:writeCreate a denylist rule to reject senders or domains. /v1/sender-rules/blacklistPATCHsender_rules:writeToggle or update a denylist rule. /v1/sender-rules/blacklistDELETEsender_rules:writeDelete a denylist rule. /v1/sender-rules/blacklist/statsGETsender_rules:readRetrieve blocked volume and monthly trend metrics.
Data comparison table
Inbound Firewall Architecture #
The AliasFleet Inbound Firewall evaluates incoming messages at the earliest possible stage of the email delivery pipeline:
Edge Rejection : When an inbound SMTP transaction arrives from a blocked sender or domain, the firewall terminates the session during the MAIL FROM envelope handshake with an RFC 5321 550 5.7.1 permanent failure code. The message body is never accepted or stored.
Mutual Exclusivity Invariant : A sender pattern cannot exist on both your allowlist and your denylist. If you attempt to allow an address that is currently blocked, the API rejects the request with CROSS_TABLE_CONFLICT.
Pattern Matching Hierarchy :
Exact : Matches specific email addresses (spammer@example.com).
Domain : Matches all senders under a domain (badcompany.com), with optional recursive subdomain coverage (includeSubdomains: true).
Pattern : Advanced wildcard matching (*@promo.*.com, alert*@monitoring.internal).
List Allowed Sender Rules #
GET /v1/sender-rules/whitelist
Returns a paginated list of allowed sender rules configured for your account.
Scope: sender_rules:read Rate Limit: 60 req/min Idempotent: Yes
Query Parameters #
Parameter Type Required Default Description pageintegerOptional 1Page number for pagination. limitintegerOptional 50Number of records per page (max 100). searchstringOptional — Case-insensitive filter on email_pattern. includeGlobalbooleanOptional falseWhen true, includes platform-wide system rules alongside account rules.
Data comparison table
Header Type Required Description AuthorizationstringOptional* Bearer afp_...x-api-keystringOptional* afp_... (*Provide either Authorization or x-api-key).AcceptstringYes application/json
Data comparison table
cURL Example #
curl -X GET "https://api.aliasfleet.com/v1/sender-rules/whitelist?page=1&limit=2" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Accept: application/json"
Response (200 OK) #
{ "entries" : [ { "id" : "7c8d9e0f-1a2b-3c4d-5e6f-7a8b9c0d1e2f" , "user_id" : "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" , "email_pattern" : "vip-notifications@partner.com" , "pattern_type" : "exact" , "include_subdomains" : false , "reason" : "Critical billing and invoice updates" , "source" : "manual" , "is_active" : true , "allowed_count" : 48 , "created_at" : "2026-08-20T10:00:00.000Z" , "updated_at" : "2026-08-20T10:00:00.000Z" } ], "pagination" : { "page" : 1 , "limit" : 2 , "total" : 1 , "totalPages" : 1 } }
Response Fields #
Field Type Description entriesarrayList of allowlisted sender entries. entries[].idstringUnique rule identifier. entries[].user_idstringAccount user ID owning this rule. entries[].email_patternstringConfigured address, domain, or wildcard pattern. entries[].pattern_typestringMatching type ("exact", "domain", or "pattern"). entries[].include_subdomainsbooleanWhether matching applies recursively to subdomains. entries[].reasonstring | nullHuman note explaining why sender is trusted. entries[].sourcestringRule source mechanism ("manual", "api"). entries[].is_activebooleanWhether rule is actively enforced. entries[].allowed_countintegerCounter of messages processed via this allow rule. entries[].created_atstringISO 8601 creation timestamp. paginationobjectPage index and total items metadata.
Data comparison table
Create Allowed Sender Rule #
POST /v1/sender-rules/whitelist
Adds a sender address, domain, or wildcard pattern to your inbound allowlist.
Scope: sender_rules:write Rate Limit: 60 req/min Idempotent: Yes
Request Body Schema #
Field Type Required Constraints Description emailPatternstringYes 1–255 chars Email (user@domain.com), domain (partner.com), or wildcard pattern (*@*.corp.com). patternTypestringOptional "exact", "domain", "pattern"Pattern evaluation strategy. Defaults to "exact". includeSubdomainsbooleanOptional Boolean When true with patternType: "domain", matches subdomains (e.g. *.partner.com). reasonstringOptional Max 255 chars Contextual note explaining why the sender is allowlisted. sourcestringOptional Max 50 chars Origin tag: "manual", "quick_action", or "api". Defaults to "manual".
Data comparison table
cURL Example #
curl -X POST "https://api.aliasfleet.com/v1/sender-rules/whitelist" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "emailPattern": "partner-network.com", "patternType": "domain", "includeSubdomains": true, "reason": "Authorized B2B syndication partner" }'
Response (201 Created) #
{ "success" : true , "entry" : { "id" : "3a4b5c6d-7e8f-9a0b-1c2d-3e4f5a6b7c8d" , "user_id" : "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" , "email_pattern" : "partner-network.com" , "pattern_type" : "domain" , "include_subdomains" : true , "reason" : "Authorized B2B syndication partner" , "source" : "manual" , "is_active" : true , "allowed_count" : 0 , "created_at" : "2026-09-04T12:00:00.000Z" , "updated_at" : "2026-09-04T12:00:00.000Z" }, "message" : "partner-network.com has been whitelisted" }
Response Fields #
Field Type Description successbooleanConfirms rule creation. entryobjectNewly created allowlist rule record. messagestringUser confirmation message.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400INVALID_PATTERN"Please enter a valid email address."The emailPattern string is malformed or invalid syntax for the chosen patternType. 402ENTITLEMENT_REQUIRED"Domain and wildcard pattern rules are only available on Pro and Business plans."Domain and wildcard pattern rules require advanced_routing feature access (Pro or Business plan). Returns { error, code: "ENTITLEMENT_REQUIRED", feature: "advanced_routing" }. 409CROSS_TABLE_CONFLICT"This pattern is already on your Blocked Senders (blacklist). A sender cannot be both allowed and blocked."The pattern already exists on your denylist. Remove it from the denylist first. 409ALREADY_EXISTS"This sender is already whitelisted"The pattern is already present on your allowlist. Includes existingId.
Data comparison table
Update Allowed Sender Rule #
PATCH /v1/sender-rules/whitelist
Toggles the active state or updates the description metadata for an existing allowlist rule.
Scope: sender_rules:write Rate Limit: 60 req/min Idempotent: Yes
Request Body Schema #
Field Type Required Constraints Description idstringYes Rule UUID Unique identifier of the rule to modify. isActivebooleanOptional Boolean Activates or pauses rule enforcement. reasonstringOptional Max 255 chars Updated note or rationale. includeSubdomainsbooleanOptional Boolean Whether domain matching extends to subdomains.
Data comparison table
cURL Example #
curl -X PATCH "https://api.aliasfleet.com/v1/sender-rules/whitelist" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "id": "3a4b5c6d-7e8f-9a0b-1c2d-3e4f5a6b7c8d", "isActive": false, "reason": "Temporarily disabled during vendor security audit" }'
Response (200 OK) #
{ "success" : true , "entry" : { "id" : "3a4b5c6d-7e8f-9a0b-1c2d-3e4f5a6b7c8d" , "user_id" : "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" , "email_pattern" : "partner-network.com" , "pattern_type" : "domain" , "include_subdomains" : true , "reason" : "Temporarily disabled during vendor security audit" , "source" : "manual" , "is_active" : false , "allowed_count" : 12 , "created_at" : "2026-09-04T12:00:00.000Z" , "updated_at" : "2026-09-04T12:15:00.000Z" } }
Response Fields #
Field Type Description successbooleanConfirms rule was updated. entryobjectUpdated allowlist record.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400NO_UPDATES"No updates provided"Request body contains no updatable fields. 404NOT_FOUND"Rule not found"No rule matching the provided id was found.
Data comparison table
Delete Allowed Sender Rule #
DELETE /v1/sender-rules/whitelist
Permanently deletes an allowlist rule from your account.
Scope: sender_rules:write Rate Limit: 60 req/min Idempotent: Yes
Query Parameters #
Parameter Type Required Description idstringYes Unique identifier (UUID) of the allowlist rule to delete passed as a query string parameter.
Data comparison table
cURL Example #
curl -X DELETE "https://api.aliasfleet.com/v1/sender-rules/whitelist?id=3a4b5c6d-7e8f-9a0b-1c2d-3e4f5a6b7c8d" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e"
Response (200 OK) #
{ "success" : true , "message" : "Removed from whitelist" }
Response Fields #
Field Type Description successbooleanConfirms deletion. messagestringOutcome status message.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400ID_REQUIRED"id is required"The ?id= query parameter was omitted.
Data comparison table
Get Allowlist Metrics #
GET /v1/sender-rules/whitelist/stats
Returns aggregated statistics regarding allowlist rule counts, lifetime forwarded volumes, and monthly trends.
Scope: sender_rules:read Rate Limit: 60 req/min Idempotent: Yes
cURL Example #
curl -X GET "https://api.aliasfleet.com/v1/sender-rules/whitelist/stats" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Accept: application/json"
Response (200 OK) #
{ "stats" : { "totalRules" : 14 , "activeRules" : 12 , "rulesTrend" : 20 , "totalAllowedEmails" : 384 , "newThisMonth" : 3 } }
Response Fields #
Field Type Description stats.totalRulesintegerTotal allowlist rules defined. stats.activeRulesintegerCount of rules actively enforced. stats.rulesTrendintegerMonth-over-month growth percentage in rules. stats.totalAllowedEmailsintegerTotal forwarded messages permitted through allowlist rules. stats.newThisMonthintegerCount of rules added during the current billing cycle.
Data comparison table
List Blocked Sender Rules #
GET /v1/sender-rules/blacklist
Returns a paginated list of blocked sender rules (denylist) configured for your account.
Scope: sender_rules:read Rate Limit: 60 req/min Idempotent: Yes
Query Parameters #
Parameter Type Required Default Description pageintegerOptional 1Page number for pagination. limitintegerOptional 50Number of records per page (max 100). searchstringOptional — Case-insensitive filter on email_pattern. includeGlobalbooleanOptional falseWhen true, includes platform-wide threat network rules alongside account rules.
Data comparison table
cURL Example #
curl -X GET "https://api.aliasfleet.com/v1/sender-rules/blacklist?page=1&limit=2" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Accept: application/json"
Response (200 OK) #
{ "entries" : [ { "id" : "b1a2b3c4-e5f6-7a8b-9c0d-1e2f3a4b5c6d" , "user_id" : "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" , "email_pattern" : "spammer.org" , "pattern_type" : "domain" , "include_subdomains" : true , "reason" : "Phishing domain targeting credentials" , "source" : "manual" , "is_active" : true , "blocked_count" : 142 , "created_at" : "2026-08-15T09:30:00.000Z" , "updated_at" : "2026-08-15T09:30:00.000Z" } ], "pagination" : { "page" : 1 , "limit" : 2 , "total" : 1 , "totalPages" : 1 } }
Response Fields #
Field Type Description entriesarrayList of blocked sender rules. entries[].idstringUnique rule identifier. entries[].user_idstringAccount user ID. entries[].email_patternstringConfigured blocked pattern. entries[].pattern_typestringMode ("exact", "domain", or "pattern"). entries[].include_subdomainsbooleanSubdomain recursive blocking flag. entries[].reasonstring | nullStored note or threat classification. entries[].sourcestringRule source mechanism. entries[].is_activebooleanWhether rule is actively rejecting messages. entries[].blocked_countintegerCount of rejected SMTP connection attempts. entries[].created_atstringISO 8601 creation timestamp. paginationobjectPage index and total items metadata.
Data comparison table
Create Blocked Sender Rule #
POST /v1/sender-rules/blacklist
Creates an inbound denylist rule to reject messages from a specific address, domain, or wildcard pattern. Blocked messages are rejected at the edge without entering your forwarding stream.
Scope: sender_rules:write Rate Limit: 60 req/min Idempotent: Yes
Request Body Schema #
Field Type Required Constraints Description emailPatternstringYes 1–255 chars Email (bad@spam.com), domain (spammer.org), or wildcard pattern (*@*.phishing.com). patternTypestringOptional "exact", "domain", "pattern"Matching mode. Auto-promoted to domain or pattern if wildcard characters are detected. includeSubdomainsbooleanOptional Boolean When true with patternType: "domain", blocks all subdomains (e.g. *.spammer.org). reasonstringOptional Max 255 chars Rationale or internal audit comment. sourcestringOptional Max 50 chars Origin tag: "manual", "quick_action", "automated_filter", or "api". Defaults to "manual".
Data comparison table
cURL Example #
curl -X POST "https://api.aliasfleet.com/v1/sender-rules/blacklist" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "emailPattern": "scamnetwork.xyz", "patternType": "domain", "includeSubdomains": true, "reason": "Persistent scam outreach campaign" }'
Response (201 Created) #
{ "success" : true , "entry" : { "id" : "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" , "user_id" : "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" , "email_pattern" : "scamnetwork.xyz" , "pattern_type" : "domain" , "include_subdomains" : true , "reason" : "Persistent scam outreach campaign" , "source" : "manual" , "is_active" : true , "blocked_count" : 0 , "created_at" : "2026-09-04T12:00:00.000Z" , "updated_at" : "2026-09-04T12:00:00.000Z" }, "message" : "scamnetwork.xyz has been blacklisted" }
Response Fields #
Field Type Description successbooleanConfirms denylist rule creation. entryobjectNewly registered blocked sender rule. messagestringOutcome status message.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400INVALID_PATTERN"Please enter a valid domain name (e.g. spammer.com)."The pattern syntax does not conform to RFC email or hostname specifications. 402ENTITLEMENT_REQUIRED"Domain and wildcard pattern rules are only available on Pro and Business plans."Domain and wildcard pattern rules require advanced_routing feature access (Pro or Business subscription). Returns { error, code: "ENTITLEMENT_REQUIRED", feature: "advanced_routing" }. 409CROSS_TABLE_CONFLICT"This pattern is already on your Allowed Senders (whitelist). A sender cannot be both allowed and blocked."Pattern already exists on your allowlist. Remove it from the allowlist first. 409ALREADY_EXISTS"This sender is already blacklisted"Pattern is already present in your denylist. Includes existingId.
Data comparison table
Update Blocked Sender Rule #
PATCH /v1/sender-rules/blacklist
Updates an existing blocked sender rule, allowing you to toggle rule enforcement on or off without deleting the rule history and counters.
Scope: sender_rules:write Rate Limit: 60 req/min Idempotent: Yes
Request Body Schema #
Field Type Required Constraints Description idstringYes Rule UUID Unique identifier of the denylist rule to modify. isActivebooleanOptional Boolean Activates or pauses rule enforcement. reasonstringOptional Max 255 chars Updated note or rationale. includeSubdomainsbooleanOptional Boolean Whether domain matching extends to subdomains.
Data comparison table
cURL Example #
curl -X PATCH "https://api.aliasfleet.com/v1/sender-rules/blacklist" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "id": "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b", "isActive": false, "reason": "Deactivated pending review of false positive" }'
Response (200 OK) #
{ "success" : true , "entry" : { "id" : "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" , "user_id" : "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" , "email_pattern" : "scamnetwork.xyz" , "pattern_type" : "domain" , "include_subdomains" : true , "reason" : "Deactivated pending review of false positive" , "source" : "manual" , "is_active" : false , "blocked_count" : 27 , "created_at" : "2026-09-04T12:00:00.000Z" , "updated_at" : "2026-09-04T12:20:00.000Z" } }
Response Fields #
Field Type Description successbooleanConfirms rule was updated. entryobjectUpdated denylist record.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400NO_UPDATES"No updates provided"Request body contains no updatable fields. 404NOT_FOUND"Rule not found"No rule matching the provided id was found.
Data comparison table
Delete Blocked Sender Rule #
DELETE /v1/sender-rules/blacklist
Permanently deletes a blocked sender rule from your account. Messages from the sender will once again be evaluated according to standard forwarding rules.
Scope: sender_rules:write Rate Limit: 60 req/min Idempotent: Yes
Query Parameters #
Parameter Type Required Description idstringYes Unique identifier (UUID) of the denylist rule to delete passed as a query string parameter.
Data comparison table
cURL Example #
curl -X DELETE "https://api.aliasfleet.com/v1/sender-rules/blacklist?id=e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e"
Response (200 OK) #
{ "success" : true , "message" : "Removed from blacklist" }
Response Fields #
Field Type Description successbooleanConfirms rule was deleted. messagestringOutcome status message.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400ID_REQUIRED"id is required"The ?id= query parameter was omitted.
Data comparison table
Get Denylist Metrics #
GET /v1/sender-rules/blacklist/stats
Returns aggregated statistics regarding blocked sender rules, lifetime rejected messages, and month-over-month threat volume trends.
Scope: sender_rules:read Rate Limit: 60 req/min Idempotent: Yes
cURL Example #
curl -X GET "https://api.aliasfleet.com/v1/sender-rules/blacklist/stats" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Accept: application/json"
Response (200 OK) #
{ "total" : 35 , "active" : 32 , "totalBlocked" : 1842 , "newThisMonth" : 6 , "newLastMonth" : 4 , "blacklistTrend" : 50 , "blockedTrend" : -12 , "blockedThisMonth" : 210 , "blockedLastMonth" : 238 }
Response Fields #
Field Type Description totalintegerTotal denylist rules configured. activeintegerCount of rules actively blocking incoming mail. totalBlockedintegerTotal inbound SMTP connection handshakes terminated by denylist rules. newThisMonthintegerCount of rules added during the active billing period. newLastMonthintegerCount of rules added during previous cycle. blacklistTrendintegerPercentage increase or decrease in rules. blockedTrendintegerPercentage change in blocked volume compared to previous cycle. blockedThisMonthintegerTotal emails dropped during current billing period. blockedLastMonthintegerTotal emails dropped during prior billing period.
Data comparison table