Approve a flagged classification
approve_classificationApproves one event from the review queue (see get_unreviewed_events) by assigning its definitive account, then resumes the paused pipeline: the event is marked reviewed, its double-entry journal lines are written, an audit trail entry records who approved it and why, and a ledger sync job is queued — all atomically. This WRITES financial data: only call it with an account you are confident in, and pass a reason a future auditor will understand (it is stored verbatim in the audit trail). Fails if the event does not exist, belongs to a different org, or is not awaiting review (e.g. already approved). 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 this account is correct. Stored verbatim in the audit trail. | |
| 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 definitive account for this event: a numeric chart-of-accounts 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 broad rollup category, which resolves to the category's default account (revenue → 4000, cost_of_goods → 5000, operating_expense → 6100). | |
| classified_event_id | Yes | The classified_event_id of a queue item from get_unreviewed_events. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| approved | Yes | ||
| new_category | Yes | ||
| new_account_code | Yes | ||
| ledger_sync_queued | Yes | ||
| classified_event_id | Yes |