Accounts
Accounts are the buckets your money moves between — the chart of accounts. This page covers managing them via the API.
Creating accounts
Create one account at a time with POST /accounts:
bash
curl -X POST "$FLYWHEEL_API/accounts" \
-H "Authorization: Bearer $FLYWHEEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_number": "1010",
"name": "Operating Bank Account",
"account_type": "asset"
}'account_type is one of asset, liability, equity, revenue, expense.
Seed the standard chart
To skip manual setup, seed a standard chart of accounts (≈40 accounts numbered 1000–9000) in one idempotent call:
bash
curl -X POST "$FLYWHEEL_API/accounts/seed" \
-H "Authorization: Bearer $FLYWHEEL_KEY"Calling it again won't create duplicates.
Listing and the account tree
GET /accounts— paginated list, filterable by type and active status.GET /accounts/tree— the chart as a hierarchy (parent/child structure).GET /accounts/{id}— a single account.PATCH /accounts/{id}— update name, active status, etc.
Balances and ledger
Each account exposes its computed balance and individual postings:
GET /accounts/{id}/balance— running balance (in base currency).GET /accounts/{id}/ledger— the account's postings over time.
Both are derived from posted journal entries.
MCP tools
The same operations are MCP tools: create_account, list_accounts,
get_account, update_account, get_account_tree, get_account_balance,
get_account_ledger, and seed_default_accounts. See
MCP tools.