Rules

Create a new rule

Changed on

Rules automatically categorize or transform transactions. A rule attached to a financial account runs on new transactions as they are fetched from the bank and its changes are permanent; a rule attached to a transfer link runs on transactions as they are transferred and only changes the destination copy.

A rule has conditions and actions. Conditions decide whether the rule applies; a rule with no conditions always applies. Actions run when it does, and every rule needs at least one. Each action that runs is recorded as a rule log.

Action values accept Liquid templates. Reference transaction fields with {{ transaction.field_name }} and transform them with filters:

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 or 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

The standard Liquid filters (replace, truncate, split, append, prepend, and so on) are available too. Values without {{ or {% are literal.

Account rules (BANK scope) attach to bank accounts only; attaching one to a crypto or brokerage account returns 422. Use a transfer link rule for those. How many conditions, actions and attached rules a plan allows is listed on the pricing page.

post/rules

Request

  • Base URL
    https://api.synci.io/api/v1
  • Auth
    • OAuth 2
      Authorization code: https://api.synci.io/oauth/authorize
      Token URL: https://api.synci.io/oauth/token
    • or HTTP bearer

Request body

namestring required

The name of the rule.

descriptionstring nullable

An optional description of what the rule does.

enabledboolean

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

trigger_on_any_conditionboolean

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

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.

scope'BANK' | 'TRANSFER'

Where a rule runs. BANK rules are applied to transactions as they are stored in Synci (changes are permanent) and attach to financial accounts or institutions. TRANSFER rules are applied while transactions are transferred to a destination (changes land only in the destination copy) and attach to transfer links. Which destinations a transfer rule fits is derived from its actions, not declared up front.

type'BANK' | 'YNAB_TRANSFER_LINK' | 'LUNCH_MONEY_TRANSFER_LINK' | 'GOOGLE_SHEETS_TRANSFER_LINK' | 'NOTION_TRANSFER_LINK'

The legacy rule type. BANK rules are applied to transactions as they are fetched from the bank and can only be attached to financial accounts. The transfer link types are applied while transactions are transferred to the destination and can only be attached to transfer links.

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.
institutionsstring[]

Reserved for Synci administrators.

Response

message'Rule created.' required

Changes

    • breaking

      the response's property type changed from no type to object for status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      removed subschema #2 from the response property allOf list for the response status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      added the required property ///// to the response with the status