Skip to main content
Rules let you automatically handle inbound emails based on conditions you define — without involving your AI. Use them to tag, route, close, or skip threads before your AI ever sees them.

Rule Structure

Each rule has one or more conditions and one or more actions. All conditions must match for the actions to run.

Conditions

FieldOperators
from_addressequals, contains, ends_with
subjectcontains, starts_with
bodycontains
to_addressequals

Actions

ActionDescription
add_tagApply a label to the thread
set_statusSet thread status (open, closed)
assign_identityRoute to a specific sender identity
skip_aiMark thread so AI does not draft a reply
auto_replySend a fixed response immediately

Creating a Rule

curl -X POST https://api.actionlayer.dev/v1/rules \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Close OOO replies",
    "conditions": [
      {"field": "subject", "operator": "contains", "value": "out of office"}
    ],
    "actions": [
      {"type": "set_status", "value": "closed"},
      {"type": "add_tag", "value": "ooo"}
    ]
  }'

Rule Evaluation

Rules run in order. The first matching rule wins — subsequent rules are not evaluated. Rules only run on inbound messages.

Use Cases

  • Auto-close out-of-office replies
  • Tag support vs. billing threads
  • Skip AI drafting for known spam patterns
  • Route to a specific identity based on recipient address
  • Send instant auto-replies for common requests