Build priority-ordered conditional routing rules, evaluate message metadata and spam metrics, and trigger automated forwarding, dropping, or webhook dispatching.
Quick Reference #
Endpoint Method Required Scope Description /v1/rulesGETrules:readList all configured routing rules ordered by priority. /v1/rulesPOSTrules:writeCreate a new conditional routing rule. /v1/rules/:idGETrules:readRetrieve configuration and conditions for a specific rule. /v1/rules/:idPATCHrules:writeUpdate rule criteria, priority, active state, or actions. /v1/rules/:idDELETErules:writePermanently delete a routing rule. /v1/rules/reorderPOSTrules:writeAtomically reorder rule evaluation priority sequence.
Data comparison table
Rule Evaluation Model #
The Rules Engine intercepts inbound transactions immediately after address resolution and evaluates messages against your account's rule chain:
Priority Pipeline : Rules run in sequence starting from priority: 1.
Compound Logic : Each rule specifies match_type: "ALL" (logical AND) or match_type: "ANY" (logical OR) across 1 to 5 conditions.
Execution Halting (stop_processing) : When set to true, a matched rule terminates the pipeline immediately. Lower-priority rules will not run for that message.
Action Composition : A single rule can execute 1 to 5 combined actions simultaneously (e.g. inject custom headers, strip tracking beacons, and dispatch a webhook).
Plan Quotas & Tier Limits #
Tier Maximum Routing Rules Behavior When Quota Reached Free 0 rules Returns HTTP 403 LIMIT_REACHED ("Rule limit reached for your subscription plan. Please upgrade to Pro or Business."). Pro 20 rules Returns HTTP 403 LIMIT_REACHED upon creating rule 21. Business Unlimited (-1)Unrestricted conditional routing rules.
Data comparison table
Supported Condition Fields & Operators #
Evaluated Fields #
Field Description Type / Constraints Example Target from_addressFull envelope sender email String (max 500 chars) billing@vendor.comfrom_domainSender domain part String (max 500 chars) vendor.comfrom_nameFriendly display name String (max 500 chars) Acme Billing Teamreply_toReply-To header addressString (max 500 chars) support@reply.vendor.comalias_addressReceiving alias address String (max 500 chars) orders@acme-corp.comalias_domainReceiving alias domain String (max 500 chars) acme-corp.comalias_forwarded_countNumber of times alias has forwarded Non-negative integer string 50is_catchallWhether receiving alias is catch-all Boolean string ("true" or "false") "true"is_spamLegacy spam flag (heuristic >= 5.0) Boolean string ("true" or "false") "true"subjectMessage subject line String (max 500 chars) Invoice #1042headerArbitrary MIME header (requires header_name) Requires header_name (max 100 chars) Value: X-Custom-Campaign email_size_kbMessage payload size in kilobytes Positive number string 1024has_attachmentsPresence of file attachments Boolean string ("true" or "false") "true"attachment_nameFilename of an attached document String (max 500 chars) report.xlsxattachment_mimeMIME type of an attachment String (max 500 chars) application/pdfspf_statusSPF verification verdict String pass, fail, softfaildkim_statusDKIM cryptographic verdict String pass, fail, nonedmarc_statusDMARC policy verdict String pass, failspam_scoreRspamd heuristic spam score Numeric string (< 5.0 clean, >= 5.0 suspected, >= 10.0 blocked) 5.0
Data comparison table
Comparison Operators #
is · is_not · contains · does_not_contain · starts_with · ends_with · matches_regex · exists · not_exists · greater_than · less_than · greater_than_or_equal · less_than_or_equal
Supported Action Types #
Action Type Parameters Behavior drop_silentlyNone Discards message silently without forwarding or bouncing. quarantineNone Isolates message in quarantine for administrative review. reroute_todestination_id (dest_... or UUID)Overrides default alias routing and forwards to specified verified destination. add_subject_prefixprefix (1–50 chars)Prepends string to email subject (e.g. [INTERNAL] ). add_subject_suffixsuffix (1–50 chars)Appends string to email subject (e.g. [Reviewed]). replace_subjectsubject (1–250 chars)Replaces the entire email subject line with custom text. replace_from_namefrom_name (1–100 chars)Overrides the envelope sender display name in forwarded email. turn_off_pgpNone Disables PGP encryption for the matched email (e.g. for OTPs and verification codes). set_banner_locationbanner_location ("top", "bottom", "off")Controls placement or suppression of the AliasFleet disclosure banner. add_to_blocklistblocklist_target ("sender_email", "sender_domain")Automatically adds sender email or domain to account blocklist upon match. auto_replyauto_reply_body (1-5000 chars)auto_reply_subject (optional, max 250 chars)auto_reply_cooldown_hours (1-168h, default 24h)Sends automated reply with RFC 3834 loop protection and recipient cooldown. strip_tracking_pixelsNone Neutralizes spy beacons and tracking pixels from HTML bodies. strip_attachmentsextensions (optional string array)Strips all or specified file attachments from forwarded message. add_custom_headerheader_name (1-100 chars)header_value (1-255 chars)Injects an RFC header into the forwarded message. deactivate_aliasNone Automatically deactivates the receiving alias upon match. send_to_webhookwebhook_endpoint_id (wh_... or UUID)Dispatches real-time JSON payload to registered webhook endpoint.
Data comparison table
List Routing Rules #
GET /v1/rules
Returns all routing rules configured for your account ordered by evaluation priority.
Scope: rules:read Rate Limit: 60 req/min Idempotent: Yes
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/rules" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Accept: application/json"
Response (200 OK) #
{ "rules" : [ { "id" : "rule_7b8c9d0e1f2a3b4c" , "name" : "Quarantine High Spam Inbound" , "description" : "Quarantine messages failing SPF or carrying high spam scores" , "is_active" : true , "priority" : 1 , "match_type" : "ANY" , "stop_processing" : true , "conditions" : [ { "field" : "spf_status" , "operator" : "is" , "value" : "fail" }, { "field" : "spam_score" , "operator" : "greater_than_or_equal" , "value" : "5.0" } ], "actions" : [ { "action_type" : "quarantine" } ], "created_at" : "2026-08-28T14:00:00.000Z" , "updated_at" : "2026-08-28T14:00:00.000Z" } ] }
Response Fields #
Field Type Description rulesarrayList of rule objects sorted ascending by priority. rules[].idstringUnique prefixed identifier for the rule (rule_...). rules[].namestringHuman-readable title of the rule. rules[].descriptionstring | nullContextual notes or rationale. rules[].is_activebooleanWhether rule is actively evaluated on incoming messages. rules[].priorityintegerSequence position in evaluation chain (1, 2, 3...). rules[].match_typestringLogical operator across conditions ("ALL" or "ANY"). rules[].stop_processingbooleanWhen true, stops evaluation of subsequent rules if matched. rules[].conditionsarrayList of field evaluations required for a match. rules[].actionsarrayList of operations executed upon match. rules[].created_atstringISO 8601 creation timestamp. rules[].updated_atstringISO 8601 last update timestamp.
Data comparison table
Create Routing Rule #
POST /v1/rules
Creates a new conditional routing rule and positions it within the evaluation pipeline.
Scope: rules:write Rate Limit: 60 req/min Idempotent: No
Request Body Schema #
Field Type Required Constraints Description namestringYes 1–120 chars Human-readable rule title. descriptionstringOptional Max 500 chars Operational notes or rationale. is_activebooleanOptional Boolean Rule active state. Defaults to true. priorityintegerOptional Min 1 Evaluation position. Defaults to next available priority. match_typestringOptional "ALL", "ANY"Condition logic: "ALL" (AND) or "ANY" (OR). Defaults to "ALL". stop_processingbooleanOptional Boolean Halt rule chain evaluation if matched. Defaults to false. conditionsarrayYes 1–5 conditions Array of condition descriptor objects. actionsarrayYes 1–5 actions Array of action descriptor objects.
Data comparison table
cURL Example #
curl -X POST "https://api.aliasfleet.com/v1/rules" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "name": "VIP Billing Forwarder", "description": "Reroute financial correspondence to finance inbox with subject tag", "priority": 2, "match_type": "ALL", "stop_processing": false, "conditions": [ { "field": "subject", "operator": "contains", "value": "Invoice" }, { "field": "from_domain", "operator": "is", "value": "accounting-partner.com" } ], "actions": [ { "action_type": "reroute_to", "destination_id": "dest_d1e2f3a4b5c67a8b" }, { "action_type": "add_subject_prefix", "prefix": "[FINANCE] " } ] }'
Response (201 Created) #
{ "message" : "Rule created successfully" , "rule" : { "id" : "rule_3e4f5a6b7c8d9e0f" , "name" : "VIP Billing Forwarder" , "description" : "Reroute financial correspondence to finance inbox with subject tag" , "is_active" : true , "priority" : 2 , "match_type" : "ALL" , "stop_processing" : false , "conditions" : [ { "field" : "subject" , "operator" : "contains" , "value" : "Invoice" }, { "field" : "from_domain" , "operator" : "is" , "value" : "accounting-partner.com" } ], "actions" : [ { "action_type" : "reroute_to" , "destination_id" : "dest_d1e2f3a4b5c67a8b" }, { "action_type" : "add_subject_prefix" , "prefix" : "[FINANCE] " } ], "created_at" : "2026-09-14T12:00:00.000Z" , "updated_at" : "2026-09-14T12:00:00.000Z" } }
Response Fields #
Field Type Description messagestringOutcome confirmation message. ruleobjectNewly provisioned rule entity. See GET /v1/rules for field definitions.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400DESTINATION_NOT_FOUND"Target destination does not exist or does not belong to your account."destination_id specified in reroute_to does not exist on your account.400DESTINATION_NOT_VERIFIED"Target destination is not verified. Please verify destination email first."Target destination has not passed verification. Verify it first under /v1/destinations. 400WEBHOOK_ENDPOINT_NOT_FOUND"Target webhook endpoint does not exist or does not belong to your account."webhook_endpoint_id specified in send_to_webhook does not exist on your account.403LIMIT_REACHED"Rule limit reached for your subscription plan. Please upgrade to Pro or Business."Maximum rule count reached for your subscription tier (Free: 0, Pro: 20).
Data comparison table
Inspect Routing Rule #
GET /v1/rules/:id
Retrieves the complete configuration, conditions, and actions for a single routing rule.
Scope: rules:read Rate Limit: 60 req/min Idempotent: Yes
Path Parameters #
Parameter Type Required Description idstringYes Rule prefixed identifier (rule_... or legacy UUID).
Data comparison table
cURL Example #
curl -X GET "https://api.aliasfleet.com/v1/rules/rule_3e4f5a6b7c8d9e0f" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Accept: application/json"
Response (200 OK) #
{ "rule" : { "id" : "rule_3e4f5a6b7c8d9e0f" , "name" : "VIP Billing Forwarder" , "is_active" : true , "priority" : 2 , "match_type" : "ALL" , "stop_processing" : false , "conditions" : [ { "field" : "subject" , "operator" : "contains" , "value" : "Invoice" } ], "actions" : [ { "action_type" : "reroute_to" , "destination_id" : "dest_d1e2f3a4b5c67a8b" } ] } }
Response Fields #
Field Type Description ruleobjectComplete rule descriptor entity.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 404NOT_FOUND"Rule not found"Rule ID does not exist or access denied.
Data comparison table
Update Routing Rule #
PATCH /v1/rules/:id
Modifies an existing routing rule. Unspecified fields remain unchanged.
Scope: rules:write Rate Limit: 60 req/min Idempotent: Yes
Path Parameters #
Parameter Type Required Description idstringYes Rule prefixed identifier (rule_... or legacy UUID).
Data comparison table
Request Body Schema #
Field Type Required Description namestringOptional Updated rule title (1–120 chars). descriptionstringOptional Updated description notes (max 500 chars). is_activebooleanOptional Toggle rule enforcement without deletion. priorityintegerOptional Update rule pipeline position (min 1). match_typestringOptional "ALL" or "ANY".stop_processingbooleanOptional Update execution halting behavior. conditionsarrayOptional Replacement conditions array (1–5 conditions). actionsarrayOptional Replacement actions array (1–5 actions).
Data comparison table
cURL Example #
curl -X PATCH "https://api.aliasfleet.com/v1/rules/rule_3e4f5a6b7c8d9e0f" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "is_active": false }'
Response (200 OK) #
{ "message" : "Rule updated successfully" , "rule" : { "id" : "rule_3e4f5a6b7c8d9e0f" , "name" : "VIP Billing Forwarder" , "is_active" : false , "priority" : 2 } }
Response Fields #
Field Type Description messagestringOutcome confirmation message. ruleobjectUpdated rule object.
Data comparison table
Delete Routing Rule #
DELETE /v1/rules/:id
Permanently deletes a routing rule and releases its quota allocation.
Scope: rules:write Rate Limit: 60 req/min Idempotent: Yes
Path Parameters #
Parameter Type Required Description idstringYes Rule prefixed identifier (rule_... or legacy UUID).
Data comparison table
cURL Example #
curl -X DELETE "https://api.aliasfleet.com/v1/rules/rule_3e4f5a6b7c8d9e0f" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e"
Response (200 OK) #
{ "success" : true , "message" : "Rule deleted successfully" }
Response Fields #
Field Type Description successbooleanIndicates successful removal. messagestringConfirms removal of the rule.
Data comparison table
Reorder Rule Priority Chain #
POST /v1/rules/reorder
Atomically reorganizes the priority sequence of all routing rules in your account. The index of each ID in the provided array defines its new priority value (index 0 becomes priority 1).
Scope: rules:write Rate Limit: 60 req/min Idempotent: Yes
Request Body Schema #
Field Type Required Constraints Description rule_idsstring[]Yes Valid rule IDs (rule_... or UUID) Ordered array of rule IDs reflecting the desired evaluation hierarchy.
Data comparison table
cURL Example #
curl -X POST "https://api.aliasfleet.com/v1/rules/reorder" \ -H "Authorization: Bearer afp_4a8f9c1b2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" \ -H "Content-Type: application/json" \ -d '{ "rule_ids": [ "rule_7b8c9d0e1f2a3b4c", "rule_3e4f5a6b7c8d9e0f" ] }'
Response (200 OK) #
{ "success" : true , "message" : "Rules reordered successfully" }
Response Fields #
Field Type Description successbooleanConfirms successful atomic reordering. messagestringOutcome confirmation message.
Data comparison table
Error Responses #
Status Code Code Error Message Reason 400VALIDATION_ERROR"Invalid input"rule_ids array contains invalid IDs or does not match account rules.
Data comparison table