Update rule
Updates future matching only; never runs history or repairs past transactions. Requires Accounting setup: Manage and API access: Manage; Transactions: Manage is not required. Supplied action fields merge into existing actions. Omitted fields stay unchanged and null removes an action from the rule, not from past transactions. Supplied conditions replace the entire flat AND list; omission preserves it, including legacy account/card_name text predicates. Legacy fields cannot be submitted as new conditions. Exact identity references and inclusive signed amount boundaries retain their Create semantics. The complete resulting definition is validated atomically and must contain at least one condition and action, including the Asset/nonzero-offset restriction. Explicitly supplied category/department IDs require current selectability/assignability, even if they equal the saved value. Omitted actions retain their existing saved associations within the authorized company/system scope, including system departments available through the company department collection, even if no longer selectable/assignable for a new rule. This does not exempt preserved actions from whole-definition validation. Invalid updates leave the rule and queued history unchanged. For a company without departments, a rule whose only action sets a department returns 404, a department action it doesn’t see is kept, and removing every action it does see returns 400 invalid_request with param actions. Rejects empty bodies, only empty actions, unknown fields, and apply_to_existing_transactions. Valid no-ops return 200 without changing the definition or cancelling queued history. A real edit cancels pending API-created historical work. Already-running history returns retryable 503 rule_busy without changes; retry with exponential backoff. Legacy unassociated UI jobs do not gain these cancellation guarantees. Reads and merges serialize against other definition writes. Exact normalized duplicates excluding this rule return 409 rule_already_exists with the accessible existing rule ID in the message; unavailable duplicate IDs return 503 rules_not_ready. Unknown, foreign-company, global, internal/system, owner-specific and mixed-owner rules all return the same 404 resource_missing. Malformed rule_ IDs return 400 invalid_request. Unsupported stored definitions return 503 rules_not_ready. No new migration or public job API is introduced.
Authorizations
Path Parameters
Body
- Option 1
- Option 2
Partial update. Conditions replace the list; actions merge by key with null for removal. The resulting definition must remain nonempty and valid. An actions-only empty object is rejected.
Replaces all conditions. Omission preserves existing conditions, including legacy text predicates.
1merchant matches the assigned merchant name; description matches the transaction description. account_id and card_id must be accessible exact stable identities. Legacy account and card_name text conditions are read-only compatibility fields and are rejected on create. Combined account/card references require a provable relationship; incompatible or unverifiable pairs are rejected. transaction_type currently represents transfer only; it is not the public transaction resource's standard/transfer/split enum. Signed amount_cents uses integer cents without absolute values or currency conversion. greater_than means >=, less_than means <=, and between includes both bounds, minimum first. Signed amounts express inflow/outflow constraints; there is no separate direction field. Consumers must handle legacy text fields and should tolerate future supported condition variants.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Response
The complete saved rule, with removed actions omitted.
The complete saved company automation definition. IDs are stable opaque rule_ identifiers, including for historical rules. No public condition IDs, priority, enable state, or historical application status are exposed. The create-time application flag is not response state.
Flat AND conditions; repeated fields express multiple constraints. Text matches are case-insensitive.
1merchant matches the assigned merchant name; description matches the transaction description. account_id and card_id match exact stable identities, never display names. Legacy account and card_name are compatibility text fields; duplicate names and contains can match multiple sources. Their original stored text is preserved. transaction_type currently represents transfer only; it is not the public transaction resource's standard/transfer/split enum. Signed amount_cents uses integer cents without absolute values or currency conversion. greater_than means >=, less_than means <=, and between includes both bounds, minimum first. Signed amounts express inflow/outflow constraints; there is no separate direction field. Consumers must handle legacy text fields and should tolerate future supported condition variants.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Only configured actions are present; absent actions are omitted rather than null. category_id and department_id preserve the saved reference's public ID, including legacy references that may no longer be selectable for a new rule. Reading a rule performs no actions. Accounting-date offsets are relative to the original transaction date on import, and do not apply historically. Nonzero offsets cannot be combined with Asset category actions.
Display names for the category, department and tag the rule's actions set, keyed like the category_name, department_name and tag_name fields on transactions. A name is present exactly when its ID is present in actions; the object is empty when the rule sets none of them. The category name is the one GET /categories shows, including the company's label override. Names are read-only: update a rule with actions, never with action_names. Account and card names for account_id and card_id conditions are not included; use GET /accounts and GET /cards.