GET /books/{book_id}/analytics is the main underwriting response for bank data. It contains Book totals, monthly account rows, enriched transactions, detected debt positions, payment schedules, counterparty clusters, and screening.
The response is computed when you request it. Changes to tags, exclusions, organization settings, or screening rules appear on the next call.
The complete typed contract is on the Analytics endpoint page. Keep that model beside your integration rather than recreating response fields from examples.
Fetch and validate the response
pathway_models.py, validate at the boundary:
Start with the Book totals
The most commonly used fields are already calculated.book_meta. The analytics response has already applied the Book’s excluded documents, accounts, positions, and revenue tags, along with organization-level business-day settings.
Gross deposits and true revenue
total_deposits includes every credit. It can contain transfers, loan proceeds, owner contributions, reversals, and operating revenue.
true_revenue includes credits that survive the active revenue-exclusion rules. The exact tag set used for the request appears in revenue_exclusion_tags.
Debt-to-income ratio
Pathway returnsdebt_to_income_ratio as a percentage. A value of 18.4 means 18.4%.
The value can be null when there is no qualifying revenue denominator.
Read statement periods
statements is chronological bank data organized by statement period. Each period contains one or more account rows.
document_ids.
Use the combined row for monthly trends
The row withaccount_id == 0 represents the combined cash position across included accounts for that statement period.
average_statement_metrics contains the average period row used by Pathway’s tables and CSV export.
Read transactions
merged_accounts contains the normalized transaction history. It is keyed by account ID as a string.
Find true revenue credits
Find loan payments
Use the tags returned byGET /parse/tags when you need a complete dynamic tag registry. For a single response, position attachment is a clean way to isolate identified debt activity:
Group by tag
A transaction can carry several tags. Decide whether your output is multi-label before aggregating.Read debt positions
Each object inpositions represents one detected relationship with a lender or funder.
status is just_funded, active, or closed. The episodes tree gives the history behind that rollup:
- An
initialepisode begins the observed relationship. - A
renewalbegins after earlier schedules have closed. - A
stackbegins while an earlier schedule is still active. - An
orphancontains payments whose advance occurred before the available statement window.
Read counterparties
counterparty_clusters groups similar transaction descriptions separately for credits and debits.
transaction_ids to trace any cluster back to the underlying activity in merged_accounts.
Read screening
When organization screening is enabled, the response includes the complete fact sheet and current result.screening_metrics contains the normalized values available to rules, including recent-month snapshots, recency measures, applicant facts, and payment-risk counts. Missing facts remain null.
Screening is evaluated during the analytics request. A rule update affects the next response without reparsing the Book.