Rules API

The Rules API allows you to manage automated categorization rules for transactions.

Endpoints

MethodEndpointDescription
GET/api/v1/rulesList all rules
GET/api/v1/rules/:idGet a single rule
POST/api/v1/rulesCreate a new rule
PUT/api/v1/rules/:idUpdate a rule
DELETE/api/v1/rules/:idDelete a rule
POST/api/v1/rules/:id/runExecute rule on matching transactions
GET/api/v1/rules/:id/previewDry-run: see which transactions a rule would match

How Rules Work

  1. Rules are evaluated in priority order (lowest number first)
  2. When a transaction matches a rule's conditions, the rule's actions are applied
  3. Multiple rules can match the same transaction
  4. If rules conflict, higher priority (lower number) wins

Quick Example

curl -X POST "https://statements.finopsbricks.com/api/v1/rules" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Salary Income",
    "conditions": [{"field": "particulars", "operator": "contains", "value": "SALARY"}],
    "actions": [{"field": "category", "value": "income"}]
  }'