Outcome
Disconnect a bank: the credential is revoked in Nexus first; accounts are marked disconnected and imported lines are kept as statement history.
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.connections.delete --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.
- connectionId: Exact connection id from the provider/settings discovery specified by this action; identifiers from different integrations are not interchangeable.
Request
DELETE /api/bank/connections/{connectionId}
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 |
|---|---|---|---|
connectionId | Required | Exact connection id from the provider/settings discovery specified by this action; identifiers from different integrations are not interchangeable. | {"type":"string","minLength":1} |
Inspect nested fields and the complete input schema.
Effects
- Revokes the stored credential in Nexus first, then marks the bank accounts disconnected. Imported statement lines are kept as history.
Interpret the response
Read $.connectionId for the returned bank_connection identifier. Empty collections and nullable fields do not discover a target.
Call app_topolo_books.bank.connections.list and confirm the connection is gone.
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.connections.delete --data @payload.json --json
topolo actions plan app_topolo_books.bank.connections.delete --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.bank.connections.delete --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.connections.delete",
"input": {
"connectionId": "bcx_4556a8445af948028e268a0199fc44cf"
},
"resourceType": "workspace",
"resourceId": "<exact granted workspace id>",
"confirm": true,
"detail": true
}
}
Successful response · HTTP 200
Input · payload.json:
{
"connectionId": "bcx_4556a8445af948028e268a0199fc44cf"
}
Captured response · HTTP 200
{
"ok": true,
"connectionId": "bcx_4556a8445af948028e268a0199fc44cf"
}
HTTP 200. Call app_topolo_books.bank.connections.list and confirm the connection is gone.
Refused response · auth_error
Input · payload.json:
{
"connectionId": "bcx_4d19f2"
}
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.connections.list and confirm the connection is gone.
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
Connect the bank again with a fresh credential; the revoked one cannot be restored.
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.
- Connect a bank: Connect a bank with a read-only API token. The token is verified against the bank first, stored encrypted in Nexus, then the bank's accounts are recorded. Refused with bank_credential_invalid if the bank rejects it.
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.