Skip to main content
Rules

Create a new rule

Rules can be used to automatically handle or manipulate bank transactions, and are a powerful tool for improving your workflows and the quality of your data.


Rules can be attached to FinancialAccounts or TransferLinks:

POST
/rules
  • When a rule is attached to a financial account, it will be applied to all new transactions as they are fetched from the bank.
  • When a rule is attached to a transfer link, it will be applied to all transactions as they are transferred to their destination.

Rules consist of Conditions and Actions:

  • Conditions are certain criteria that must be met for a rule to be applied. If no conditions are provided, the rule's actions will always be executed.
  • Actions are executed when a rule's conditions are met. Every rule must have at least one action. Every time an action is executed, a new RuleLog is created.

Action values support Liquid templates for dynamic expressions. Use {{ transaction.field_name }} to reference transaction fields and apply filters to transform values:

FilterExampleDescription
remove{{ transaction.creditor.name | remove: "PREFIX " }}Remove a substring
upcase / downcase{{ transaction.creditor.name | upcase }}Change case
regex_capture{{ transaction.creditor.name | regex_capture: '/^(\w+)/' }}Extract a regex capture group
date_add{{ transaction.booking_date | date_add: 7 }}Add/subtract days from a date
remove_at{{ transaction.memo | remove_at: 1, 5 }}Remove characters at positions
keep_at{{ transaction.memo | keep_at: 6 }}Keep only characters from a position

All standard Liquid filters (replace, truncate, split, append, prepend, etc.) are also available. Plain strings without {{ or {% are treated as literal values.

The maximum number of conditions and actions per rule, and the number of rules that can be attached to each financial account or transfer link, depend on your plan. To see more information about plan limits, see the Synci Pricing page.

Note: Account rules (BANK type) can only be attached to bank accounts. Attempting to attach a BANK rule to a crypto / brokerage account returns a 422. Use a Transfer Link rule instead — those work for any source and operate on the destination fields directly.

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
actionsobject[]

The actions to execute when the rule's conditions are met. Every rule must have at least one action.

banksobject[]
conditionsobject[]

The conditions that must be met for the rule to be applied. If no conditions are provided, the rule's actions will always be executed.

descriptionstring | null

An optional description of what the rule does.

Maximum string length: 192
enabledboolean

Whether the rule is active. Disabled rules are not applied.

financial_accountsobject[]

The financial accounts to attach the rule to, each with an id and an order. Only allowed for BANK rules.

institutionsstring[]

Reserved for Synci administrators.

namestringrequired

The name of the rule.

Maximum string length: 64
scopeenum<string>

Where the rule runs:

  • BANK: applied to transactions as they are stored in Synci (changes are permanent). Can only be attached to financial accounts.
  • TRANSFER: applied while transactions are transferred to a destination (changes land only in the destination copy). Can only be attached to transfer links; which destinations the rule fits is derived from its actions.
Available options: BANK, TRANSFER
skip_other_rules_when_triggeredboolean

If the rule's conditions are met, stop processing other rules attached to the same financial account or transfer link.

The transfer links to attach the rule to, each with an id and an order. Only allowed for transfer link rule types.

trigger_on_any_conditionboolean

When enabled, only one condition must match for the rule to be applied.

typeenum<string>

The legacy rule type (BANK, YNAB_TRANSFER_LINK, LUNCH_MONEY_TRANSFER_LINK, **GOOGLE_SHEETS_TRANSFER_LINK**). Deprecated: send scope` instead. When both are provided they must agree.

BANK <br/> Applied to bank transactions as they are fetched. Attaches to financial accounts.
YNAB_TRANSFER_LINK <br/> Applied while transferring transactions to a YNAB budget account.
LUNCH_MONEY_TRANSFER_LINK <br/> Applied while transferring transactions to a Lunch Money account.
GOOGLE_SHEETS_TRANSFER_LINK <br/> Applied while transferring transactions to a Google Sheet.
NOTION_TRANSFER_LINK <br/> Applied while transferring transactions to a Notion database.
Available options: BANK, YNAB_TRANSFER_LINK, LUNCH_MONEY_TRANSFER_LINK, GOOGLE_SHEETS_TRANSFER_LINK, NOTION_TRANSFER_LINK

Response

application/json
dataobjectrequired
messagestringrequired