What rules do
A rule is a JSON document that pairs a condition (which transactions to match) with one or more actions (what to do with them). Rules run at sync time in a defined pipeline order. You can also apply rules retroactively to your full transaction history at any time. A single rule can:- Set a transaction’s category (
set_category) - Add a tag to the transaction (
add_tag) - Remove a tag from the transaction (
remove_tag) - Leave an automated comment explaining the categorization (
add_comment) - Link the transaction to a recurring series (
assign_series)
Condition structure
Rule conditions use a recursive tree of leaf nodes and combinators. A leaf node tests a single field:{} matches every transaction.
Available fields
Use
category (not category_primary or category_detailed) when you want a condition to react to the category that Breadbox or a prior rule assigned. The category_primary and category_detailed fields always hold the provider’s original values and never change.Operators by field type
String fields (name, merchant_name, category_primary, category_detailed, category, provider, account_name, user_name):
Numeric fields (
amount):
Boolean fields (
pending):
Tag fields (
tags):
Pipeline stages
Rules run in pipeline order — lower stage numbers run first. Forset_category, the last matching rule wins, so higher-stage rules have the final say on categorization. For add_tag and add_comment, every matching rule contributes.
Supply
stage as a string in the request body. You can also supply a raw priority integer (0–1000) for fine-grained ordering within a stage. If you supply both, priority wins.
Rule chaining
Because rules run in pipeline order and share a mutable transaction context, later rules can react to what earlier rules did. A rule that assigns a category at stage 0 makes that category readable viafield: "category" for any rule at stage 10 or higher in the same sync pass.
Creating a rule
Here is a complete example that categorizes Amazon purchases:trigger specified defaults to , which means it fires only on newly synced transactions. Use always to also run on re-synced changes, or on_change to run only when an existing transaction is modified.
Previewing a rule
Before saving a rule, you can dry-run its condition against your existing transactions to see what it would match:Applying a rule retroactively
After creating or editing a rule, apply it to your full transaction history without waiting for the next sync:category_override is not 'none' are skipped for set_category actions, just as they are during sync.
Respecting manual overrides
If a transaction has been manually categorized (itscategory_override is 'user'), a rule’s set_category action is skipped for that transaction. The rule still runs — add_tag and add_comment actions fire normally — but the category is not changed. This means you can safely apply rules in bulk without worrying about undoing deliberate manual work.
Assign a series
Theassign_series action links a matching transaction to a recurring series — a subscription or other repeating charge. It’s the series counterpart to set_category: author the rule once and every future matching charge joins the series automatically. Provide exactly one of:
series_short_id— link to an existing series by its short ID.merchant_key+create_if_missing: true— mint a household series for that merchant the first time a charge matches, then link every future match to it.
assign_series materializes at sync time and on single-rule retroactive apply (POST /rules/{id}/apply) — applying that one rule links matching existing transactions. The bulk apply-all path doesn’t materialize assign_series yet, so apply the rule on its own to back-fill. You can also link a charge by hand or with the assign_series MCP tool.Related reading
- Rules API — REST endpoints for creating, listing, updating, deleting, applying, and previewing rules.
- MCP: rules (read) and MCP: rules (write) — the equivalent tools agents use to create and maintain rules on your behalf.
- Categories — how the two-level hierarchy that rules target is structured.
- Review workflow — how the seeded
needs-reviewrule drives the default triage queue.