List rules
Response
Get a single rule
Path parameters
The rule’s Breadbox UUID or short ID.
Create a rule
POST /api/v1/rules/{id}/apply after creation.
Auth: Write
Request body
Human-readable name for the rule (e.g.,
"Netflix subscription").Whether the rule is active. Disabled rules are skipped during sync.
Pipeline stage. One of:
baseline, standard, refinement, override. Resolves to priority 0, 10, 50, or 100 respectively. Stage names are case-insensitive. If both stage and priority are provided, priority wins.Raw pipeline priority integer from
0 to 1000. Lower numbers run first. Overrides stage when both are provided.The condition tree to evaluate. See Condition structure below.
The field to set when the condition matches. Typically
"category_slug".The value to assign to
action_field. For category rules, this is the category slug.Response
Returns the created rule with201 Created.
Update a rule
Path parameters
The rule’s Breadbox UUID or short ID.
Delete a rule
Path parameters
The rule’s Breadbox UUID or short ID.
Apply a rule retroactively
category_override are skipped. Returns the number of transactions updated.
Auth: Write
Path parameters
The rule’s Breadbox UUID or short ID.
Response
Apply all rules retroactively
category_override are skipped. This is equivalent to re-running the full categorization pipeline on historical data.
Auth: Write
Response
Preview a condition (dry run)
Request body
The condition tree to evaluate. Uses the same structure as rule conditions.
Maximum number of matching transactions to return for preview.
Response
Condition structure
Rules use a recursive JSON condition tree. A condition node is either a leaf (field comparison) or a composite (logical combination of other nodes).Composite nodes
| Type | Description |
|---|---|
and | All child conditions must match. |
or | At least one child condition must match. |
not | The single child condition must not match. |
Leaf nodes
| Field | Description |
|---|---|
field | Transaction field to evaluate (see available fields below). |
operator | Comparison operator (see operators below). |
value | The value to compare against. |
Available fields
| Field | Type | Description |
|---|---|---|
name | string | Raw transaction name from the institution. |
merchant_name | string | Cleaned merchant name from the provider. |
amount | numeric | Transaction amount (Plaid convention: positive = debit). |
category_primary | string | Current primary category. |
category_detailed | string | Current detailed subcategory. |
pending | boolean | Whether the transaction is pending. |
provider | string | Data provider (plaid, teller, csv). |
account_id | string | Breadbox account UUID. |
user_id | string | Breadbox user UUID. |
user_name | string | Family member display name. |
Operators by field type
String operators| Operator | Description |
|---|---|
eq | Exact match (case-sensitive). |
neq | Not equal. |
contains | Case-insensitive substring match. |
not_contains | Does not contain the substring. |
matches | Regular expression match. |
in | Value is one of a list (pass value as an array). |
| Operator | Description |
|---|---|
eq | Equal. |
neq | Not equal. |
gt | Greater than. |
gte | Greater than or equal. |
lt | Less than. |
lte | Less than or equal. |
| Operator | Description |
|---|---|
eq | Equal to true or false. |
neq | Not equal. |
Pipeline stages
Rules run in priority order during sync. Lower priority numbers run first, so earlier stages can set a baseline that later stages can refine or override.| Stage | Priority | Description |
|---|---|---|
baseline | 0 | Broad catch-all rules that categorize the most common transactions. |
standard | 10 | Default stage. Regular categorization rules. |
refinement | 50 | Rules that correct or narrow categories set by earlier stages. |
override | 100 | High-confidence rules that should always win, regardless of earlier results. |
category_override are skipped by all pipeline stages.
Error codes
| Condition | Status | Code |
|---|---|---|
| Missing or invalid API key | 401 | MISSING_API_KEY / INVALID_API_KEY |
| Rule not found | 404 | NOT_FOUND |
Unknown stage value | 400 | VALIDATION_ERROR |
| Invalid condition structure | 422 | VALIDATION_ERROR |
| Attempting to delete a system rule | 422 | VALIDATION_ERROR |