Re-point a counterparty rule at a different account
update_counterparty_ruleChanges the target account of an existing counterparty rule. This affects FUTURE classification only: events already booked from this counterparty are NOT re-categorised or re-synced — only events classified after this change use the new account. Writes an audit entry recording the before/after account. Idempotent: setting the account it already has is a no-op. actor_id is optional — it defaults to the organisation entity, and if provided must belong to this org.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org_id | No | Optional. Defaults to the organisation the authenticated API key is bound to, so you normally omit it and never need to ask the user for their organisation UUID. If provided, it must match the key’s org or the request is rejected. | 0e91146d-511c-469f-bdee-5c867b26ae0d |
| reason | Yes | Why the new account is correct. Stored verbatim in the audit trail. | |
| rule_id | Yes | The rule_id from list_counterparty_rules. | |
| actor_id | No | Optional. Defaults to the organisation entity (correct for an org-scoped key). If provided, it must be an entity belonging to this organisation — arbitrary UUIDs are rejected, so the audit trail cannot be attributed to someone else. | |
| approved_category | Yes | The new account future events from this counterparty are classified as: a numeric chart code (4000 SaaS Revenue, 4100 Usage Revenue, 4900 Other Income, 5000 API & Compute Costs, 5100 Payment Processing Fees, 5200 Platform Commission, 6100 Software Subscriptions, 6200 Contractor & Freelancer, 6300 Marketing & Ads, 6400 Banking & Finance Fees, 6500 Payroll, 6600 Taxes, 6700 Foreign Exchange Gain/Loss, 6750 Unrealized FX Gain/Loss, 6800 Office & Equipment, 6810 Travel, 6820 Meals & Entertainment, 6830 Professional Services, 6840 Insurance, 6900 Other Expenses, 2100 Accounts Payable, 3900 Owner Contributions & Transfers, 1100 Cash & Bank, 1150 Stripe Receivable, 1160 App Store / Play Receivable, 1200 Stripe Settlement) or a rollup category (revenue → 4000, cost_of_goods → 5000, operating_expense → 6100). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_id | Yes | ||
| category | Yes | ||
| direction | Yes | ||
| account_code | Yes | ||
| counterparty_key | Yes |