Outcome
Change any field of a rule. Lines already coded by it are unchanged.
Before you start
- Verify the intended environment, authenticated identity and specifically approved organization context.
- The published application permission is banking:write. Discover the exact granted canonical Books workspace and bind it separately from action input.
- Approve the actual mutation, accounting inputs and any provider/recipient effects before CLI --confirm or MCP confirm:true. Fixture identifiers and simulated provider responses authorize no live operation.
Discover the target
topolo whoami --json
topolo actions get app_topolo_books.bank.rules.update --detail --json
topolo resources topolo-books --json
topolo workspaces list topolo-books --json
- Set BOOKS_WORKSPACE_ID to the exact granted workspace returned by discovery.
- ruleId: Exact bank rule.id from bank.rules.list/get, not its display label.
- bankAccountId: Exact local bank account.id from bank.accounts.list; a provider account identifier is separate.
- accountId: Exact account.id from accounts.list/get; a chart code is not an id.
- contactId: Exact contact.id from contacts.list/get; a name or email address is not an id.
- taxRateId: Resolve this exact identifier through the related published reads for the same organization and workspace; never infer it from a name.
Request
PATCH /api/bank/rules/{ruleId}
Inspect and test this action. Save the reviewed input as payload.json; supply credential/resource context separately.
Input fields
| Field | Required | Meaning | Schema and constraints |
|---|---|---|---|
ruleId | Required | Exact bank rule.id from bank.rules.list/get, not its display label. | {"type":"string","minLength":1} |
name | Optional | name | {"type":"string","minLength":1,"maxLength":120} |
bankAccountId | Optional | Exact local bank account.id from bank.accounts.list; a provider account identifier is separate. | {"anyOf":[{"type":"string","minLength":1},{"type":"null"}]} |
direction | Optional | direction | {"type":"string","enum":["in","out","any"]} |
matchField | Optional | match Field | {"type":"string","enum":["description","counterparty","either"]} |
matchKind | Optional | match Kind | {"type":"string","enum":["contains","equals","starts_with"]} |
matchText | Optional | match Text | {"type":"string","minLength":1,"maxLength":200} |
amountMinMinor | Optional | amount Min Minor | {"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]} |
amountMaxMinor | Optional | amount Max Minor | {"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]} |
accountId | Optional | Exact account.id from accounts.list/get; a chart code is not an id. | {"type":"string","minLength":1} |
contactId | Optional | Exact contact.id from contacts.list/get; a name or email address is not an id. | {"anyOf":[{"type":"string","minLength":1},{"type":"null"}]} |
taxRateId | Optional | tax Rate Id | {"anyOf":[{"type":"string","minLength":1},{"type":"null"}]} |
memo | Optional | memo | {"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]} |
priority | Optional | priority | {"type":"integer","minimum":1,"maximum":9999} |
Inspect nested fields and the complete input schema.
Effects
- Changes the rule for future runs. Lines already coded by it are unchanged.
Interpret the response
Read $.rule.id for the returned bank_rule identifier. Empty collections and nullable fields do not discover a target.
Call app_topolo_books.bank.rules.list and compare the rule.
Inspect the success schema. CLI/MCP add their own transport envelope; CLI --detail requests the full result.
Worked examples
Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.
Run a reviewed request
Save the input from the selected worked example as payload.json. Validate and inspect the plan before calling the action; refused examples demonstrate errors and are not instructions to execute.
CLI:
topolo actions validate app_topolo_books.bank.rules.update --data @payload.json --json
topolo actions plan app_topolo_books.bank.rules.update --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.bank.rules.update --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --confirm --detail --json
MCP tool and arguments for the first successful example:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_books.bank.rules.update",
"input": {
"ruleId": "brl_51c61882d14a493fba93c2a0c704d045",
"priority": 3
},
"resourceType": "workspace",
"resourceId": "<exact granted workspace id>",
"confirm": true,
"detail": true
}
}
Successful response · HTTP 200
Input · payload.json:
{
"ruleId": "brl_51c61882d14a493fba93c2a0c704d045",
"priority": 3
}
Captured response · HTTP 200
{
"rule": {
"id": "brl_51c61882d14a493fba93c2a0c704d045",
"organization_id": "org_brl_muvnpysr4",
"workspace_id": "ws_brl_muvnpysr4",
"name": "Fees",
"bank_account_id": null,
"direction": "out",
"match_field": "description",
"match_kind": "contains",
"match_text": "fee",
"amount_min_minor": null,
"amount_max_minor": null,
"account_id": "acc_6d2ff297f77342e0a956958fd027ea0b",
"contact_id": null,
"tax_rate_id": null,
"memo": null,
"priority": 3,
"status": "active",
"times_applied": 0,
"last_applied_at": null,
"created_by": "usr_test",
"created_at": "2026-10-05T19:42:54.325Z",
"updated_at": "2026-10-05T19:42:54.328Z"
}
}
HTTP 200. Call app_topolo_books.bank.rules.list and compare the rule.
Refused response · auth_error
Input · payload.json:
{
"ruleId": "brl_7f3c1b",
"priority": 5,
"memo": "Card processor payout"
}
Captured response · HTTP 401
{
"error": "API key validation failed"
}
HTTP 401. SDK error code auth_error. Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.
Verify the result
- Call app_topolo_books.bank.rules.list and compare the rule.
Errors and recovery
auth_error(HTTP 401): Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.
These are observed local refusals. Shared authentication, schema validation and resource authorization can also refuse before the route. Preserve the actual error, details and request id.
Recovery boundary
Read the rule first, then send the previous field values back.
Related actions
- List bank accounts: List the bank accounts reported by connected banks, with cached balances and the ledger account each maps to. linkedOnly returns just the accounts pointed at a ledger account.
Evidence
Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.