REST API
A month of books from the CLI
Import, categorize, exclude, split, reconcile, lock and report one month with the 42six command line, every change previewed and then applied.
Before you start
- The 42six command line (Node 22 or later) is not yet published for download. Each command below is one REST call: a change is POST /ops/<name> (the preview) and then POST /plans/<
plan_id>/apply, and a read is the route of the same name in the OpenAPI document (GET, or POST /reads/<name>), so the month runs the same way over REST. - Create the key under Settings › API keys as a key that reaches all books, with these families: bank:read and ledger:read (the reads), bank:write (categorize), bank:manage (exclude, split and post), setup:write (import), close:write (reconcile and lock) and reports:read (the reports). The extra families are only for a key that reaches all books.
- A key belongs to one workspace. It reaches that workspace's books and no other, and nothing you send names a workspace.
- Every change is two commands. The first previews it, changes nothing, and prints on stderr the exact 42six apply --plan-id command that applies it. A plan expires 10 minutes after its preview. If the books changed since the preview, apply refuses with
stale_planand changes nothing: preview again. - Every id, name and amount below is an example. July 2026 is the month; your books answer with their own ids.
42six login # paste the ftx_ key at the hidden prompt
42six entities # the books the key reaches; each one's id is the ENTITY_ID belowStep 1: Find the book and its accounts
42six accounts --entity ENTITY_ID- Note the id of the bank account you will reconcile (Checking here) and the names of the accounts you categorize to. categorize takes an account by id, code or exact name; the other commands take account ids.
You should see. The chart lists Checking, Sales, Office Supplies, Software, Meals and Rent.
If it goes wrong. Entities lists no book, or accounts answers 404. The key reaches only its own workspace's books; use a key made in the workspace that holds the book.
Step 2: Check the bank connection
A bank is connected in the app, under Settings › Connections: the bank's own sign-in runs there, not in a terminal. From then on the command line reads what the connection holds.
42six connection-status --entity-id ENTITY_ID
42six connection-accounts --entity-id ENTITY_ID- connection-status lists each connection with its provider, status and last good sync. connection-accounts lists each account the bank reports, with the chart account it feeds.
You should see. The connection is active and each of its accounts feeds the chart account you expect. Its transactions arrive in review on their own.
If it goes wrong. A connection needs the bank's sign-in again. Reconnect it in the app under Settings › Connections; the command line cannot.
Step 3: Import the month
An account no connection feeds (Checking here) gets its month from the bank's export. Write the rows as JSON: a positive amount is money out, a negative amount money in.
{
"entity_id": "00000000-0000-4000-8000-000000000001",
"account_id": "00000000-0000-4000-8000-000000000010",
"items": [
{
"posted_date": "2026-07-01",
"amount": "-2500.00",
"description": "ACME CO PAYMENT",
"external_id": "jul-01"
},
{
"posted_date": "2026-07-06",
"amount": "120.00",
"description": "OFFICE DEPOT 1234",
"external_id": "jul-02"
},
{
"posted_date": "2026-07-09",
"amount": "54.99",
"description": "ADOBE CREATIVE CLOUD",
"external_id": "jul-03"
},
{
"posted_date": "2026-07-10",
"amount": "54.99",
"description": "ADOBE CREATIVE CLOUD COPY",
"external_id": "jul-04"
},
{
"posted_date": "2026-07-12",
"amount": "300.00",
"description": "COSTCO WHOLESALE",
"external_id": "jul-05"
},
{
"posted_date": "2026-07-14",
"amount": "35.50",
"description": "STAPLES 0099",
"external_id": "jul-06"
},
{
"posted_date": "2026-07-20",
"amount": "-1000.00",
"description": "BETA LLC PAYMENT",
"external_id": "jul-07"
},
{
"posted_date": "2026-07-28",
"amount": "400.00",
"description": "CHECK 1001",
"external_id": "jul-08"
}
]
}42six import-bank-feed-items --input july.json
42six apply --plan-id PLAN_IDYou should see. Needs-review --entity ENTITY_ID lists the eight rows, nothing posted yet.
If it goes wrong. A row dated before the books' start, or on or before their opening balances date, is refused, and the preview says so. A row already imported is skipped, so importing the same file twice adds nothing.
Step 4: Categorize
42six needs-review --entity ENTITY_ID
42six categorize --entity ENTITY_ID --item-ids ITEM_ID,ITEM_ID --account "Sales"
42six apply --plan-id PLAN_ID
42six categorize --entity ENTITY_ID --item-ids ITEM_ID,ITEM_ID --account "Office Supplies"
42six apply --plan-id PLAN_ID
42six categorize --entity ENTITY_ID --item-ids ITEM_ID --account "Software"
42six apply --plan-id PLAN_ID
42six categorize --entity ENTITY_ID --item-ids ITEM_ID --account "Rent"
42six apply --plan-id PLAN_ID- The two deposits go to Sales, Office Depot and Staples to Office Supplies, Adobe to Software and Check 1001 to Rent: one preview and one apply each. An applied categorize posts the transaction at once.
You should see. The preview's summary names each transaction and the account, and after apply they leave needs-review.
If it goes wrong. With several transactions, the preview leaves out any that cannot be categorized (already posted, in a locked period) and says why. One transaction that is already posted previews a recategorize instead, moving it to the new account, so read the summary before you apply. A name that matches more than one account is refused: give the account's code or id from 42six accounts instead.
Step 5: Exclude a duplicate
42six exclude-feed-item --item-id ITEM_ID --reason "Duplicate row"
42six apply --plan-id PLAN_ID- The bank sent the Adobe charge twice. Exclude the copy so it never reaches the books.
You should see. The copy leaves needs-review and is never posted.
If it goes wrong. The wrong row was excluded. restore-feed-item --item-id ITEM_ID previews bringing it back.
Step 6: Split a transaction
Costco was 220.00 of supplies and 80.00 of meals. A split's lines go in a file; they add up to the transaction.
{
"item_id": "00000000-0000-4000-8000-000000000030",
"lines": [
{
"account_id": "00000000-0000-4000-8000-000000000013",
"debit": "220.00"
},
{
"account_id": "00000000-0000-4000-8000-000000000017",
"debit": "80.00"
}
]
}42six set-feed-item-split --input split.json
42six apply --plan-id PLAN_ID
42six post-feed-items --entity-id ENTITY_ID --item-ids ITEM_ID
42six apply --plan-id PLAN_ID- set-feed-item-split records the split; post-feed-items posts it as one entry: Office Supplies 220.00 and Meals 80.00 against Checking 300.00.
You should see. Needs-review is empty for July.
If it goes wrong. The lines do not add up to the transaction, and the preview is refused. Fix the amounts in the file and preview again.
Step 7: Reconcile the bank account
42six start-reconciliation --entity-id ENTITY_ID --account-id CHECKING_ACCOUNT_ID --period-end 2026-07-31
42six apply --plan-id PLAN_ID # the answer's result.reconciliation_id is the session
42six reconciliation-session --reconciliation-id RECONCILIATION_ID
42six save-reconciliation-session --reconciliation-id RECONCILIATION_ID --statement-balance 2989.51 --ticked ID_1,ID_2,ID_3,ID_4,ID_5,ID_6
42six apply --plan-id PLAN_ID
42six complete-reconciliation --reconciliation-id RECONCILIATION_ID
42six apply --plan-id PLAN_ID- start-reconciliation opens July with every posted transaction ticked. reconciliation-session lists them (each id, date, amount and whether it is ticked) with the beginning, cleared and statement balances and the difference.
- The statement says 2989.51 because Check 1001 has not cleared. Save the statement balance with every transaction the statement shows as cleared: the ids of the items reconciliation-session lists, all but the check (six here). --ticked is the whole set, not a change to it.
You should see. After the save, reconciliation-session shows a difference of 0.00, and complete-reconciliation finishes July.
If it goes wrong. Complete-reconciliation is refused while the difference is not zero, or while a transaction dated in the month is still in needs-review (backlog in the session counts them). Post or exclude those, check the ticks and the statement balance, and save again.
Step 8: Close the month
42six lock-books-through --entity-id ENTITY_ID --through 2026-07-31
42six apply --plan-id PLAN_ID- Nothing dated on or before July 31 can change until the books are reopened with a reason (reopen-books).
You should see. Period-locks --entity ENTITY_ID shows July locked, and a change dated in July is refused with period_locked (423).
If it goes wrong. The lock is refused because a fiscal year it covers has no account chosen to close into. Choose the retained earnings account in the app, then lock again.
Step 9: Report the month
42six trial-balance --entity ENTITY_ID --from 2026-07-01 --to 2026-08-01
42six income-statement --entity ENTITY_ID --from 2026-07-01 --to 2026-08-01
42six balance-sheet --entity ENTITY_ID --as-of 2026-07-31
42six trial-balance-document --entity-id ENTITY_ID --from 2026-07-01 --to 2026-08-01
42six ledger-imbalance --entity-id ENTITY_ID- Dates are half-open: --to 2026-08-01 ends the window with July 31. Money is a decimal string.
You should see. The trial balance ends July with Checking 2589.51, Sales -3500.00, Office Supplies 375.50, Software 54.99, Meals 80.00 and Rent 400.00. trial-balance-document totals July's debits and credits at 4410.49 each, a difference of 0.00, and ledger-imbalance answers 0.00. The income statement shows revenue 3500.00, operating expenses 910.49 and net income 2589.51.
If it goes wrong. A figure differs from what you expect. account-ledger-detail --entity ENTITY_ID --from 2026-07-01 --to 2026-08-01 --account ACCOUNT_ID traces an account's balance to its posted lines.