Skip to main content
This guide walks you through creating and managing Transaction Monitoring Rules - configurable conditions that automatically evaluate transactions and trigger actions like alert creation. Full API reference is available in the API Reference.

Overview

Corsa’s rule engine allows you to:
  1. Browse pre-built rule templates for common compliance scenarios
  2. Copy templates to your workspace or create custom rules from scratch
  3. Activate rules to run against incoming transactions
  4. Evaluate transactions on-demand against your active rules
Rules follow a lifecycle: DraftActiveDisabled.

Step 1: Browse Rule Templates

Endpoint: GET /v1/rule-templates List available pre-built templates with pagination and filtering.
GET /v1/rule-templates?limit=20&page=1
You can filter templates by name, products, or typologies:
GET /v1/rule-templates?search=withdrawal&filter.products=$eq:crypto

Get a Specific Template

Endpoint: GET /v1/rule-templates/{id}
GET /v1/rule-templates/template-uuid

Step 2: Copy a Template to Your Workspace

Endpoint: POST /v1/rule-templates/{id}/copy Copy a template into your workspace as a draft rule that you can customize.
POST /v1/rule-templates/template-uuid/copy
The copied rule will be created in draft status, allowing you to modify conditions and actions before activating.

Step 3: Create a Custom Rule

Endpoint: POST /v1/rules Create a rule from scratch with custom conditions and actions.
POST /v1/rules
Content-Type: application/json

{
  "name": "High-risk withdrawal detection",
  "description": "Alert when high-risk customers make large withdrawals exceeding $50,000 in 24 hours",
  "conditions": {
    "all": [
      {
        "label": "High-risk customer",
        "entity": "client",
        "property": "riskTier",
        "operator": "equal",
        "value": "HIGH"
      },
      {
        "label": "Large withdrawal amount",
        "entity": "transaction",
        "aggregationProperty": "amount",
        "aggregationOperator": "sum",
        "aggregationTimeType": "in_the_last",
        "aggregationTimeValue": 1,
        "aggregationTimePeriod": "days",
        "aggregationFilters": [
          {
            "property": "type",
            "operator": "equal",
            "value": "WITHDRAW"
          }
        ],
        "operator": "greaterThanInclusive",
        "value": 50000
      }
    ]
  },
  "actions": [
    {
      "type": "CREATE_ALERT",
      "config": {
        "category": "TRANSACTION_MONITORING",
        "priority": "HIGH",
        "status": "NEW"
      }
    }
  ]
}

Rule Structure

FieldRequiredDescription
nameYesHuman-readable rule name
conditionsYesRule conditions using all (AND) / any (OR) logic
actionsYesActions to execute when the rule matches
descriptionNoDetailed description of the rule’s purpose

Condition Operators

Conditions can target properties on client or transaction entities and support operators like equal, notEqual, greaterThan, lessThan, greaterThanInclusive, lessThanInclusive, contains, and more. Aggregation conditions allow you to evaluate sums, counts, or averages over a time window (e.g., “total withdrawals in the last 24 hours”).

Step 4: Activate or Disable a Rule

Rules must be activated before they evaluate transactions.

Activate a Rule

Endpoint: POST /v1/rules/{id}/activate
POST /v1/rules/rule-uuid/activate

Disable a Rule

Endpoint: POST /v1/rules/{id}/disable
POST /v1/rules/rule-uuid/disable
Only draft or previously disabled rules can be activated. Only active rules can be disabled.

Step 5: Update or Delete a Rule

Update a Rule

Endpoint: PUT /v1/rules/{id} Modify a rule’s name, description, conditions, or actions.
PUT /v1/rules/rule-uuid
Content-Type: application/json

{
  "name": "Updated rule name",
  "description": "Modified detection threshold",
  "conditions": {
    "all": [
      {
        "label": "Very large withdrawal",
        "entity": "transaction",
        "property": "amount",
        "operator": "greaterThanInclusive",
        "value": 100000
      }
    ]
  }
}

Delete a Rule

Endpoint: DELETE /v1/rules/{id} Only non-active (draft or disabled) rules can be deleted.
DELETE /v1/rules/rule-uuid?reason=No+longer+needed

Step 6: Evaluate Transactions Against Rules

Endpoint: POST /v1/evaluation/evaluate Evaluate a transaction against all active rules on-demand. This is useful for testing rules or evaluating transactions outside of the normal ingestion flow.
POST /v1/evaluation/evaluate
Content-Type: application/json

{
  "transactionId": "txn-uuid-123",
  "transactionData": {
    "amount": 75000,
    "currency": "USD",
    "type": "WITHDRAW",
    "clientId": "client-uuid-123"
  }
}

Step 7: View Evaluation Results

Results by Rule

Endpoint: GET /v1/evaluation/rule/{ruleId}/results See all transactions that were evaluated against a specific rule.
GET /v1/evaluation/rule/rule-uuid/results?page=1&pageSize=20

Results by Transaction

Endpoint: GET /v1/evaluation/transaction/{transactionId}/results See all rules that were evaluated against a specific transaction.
GET /v1/evaluation/transaction/txn-uuid-123/results?page=1&pageSize=20

What’s Next?

Ingest Operations

Ingest deposits, withdrawals, and trades to be evaluated by your rules.

Manage Alerts & Cases

Manage alerts created by rule evaluations.