Skip to Content
BlitzPulse docs are live. Looking for Blitz Global? Visit https://blitzglobalcapital.com.
Api ReferenceAnalytics API

Analytics API

Auto-generated from openapi-snapshot.json. Do not edit by hand — changes are overwritten by scripts/docs/generate_api_reference.py.

9 endpoints in this group.

GET /api/analytics/aum

Get Aum

AUM history for the authenticated tenant (#714) with capital breakdown: net_capital = contributed capital from capital_accounts unrealized = sum of unrealized_pnl from latest snapshot realized_ytd = sum of gain_loss from realized_trades YTD total_aum = net_capital + unrealized + realized_ytd

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/cumulative-pnl

Cumulative Pnl

Cumulative P&L series for the authenticated tenant (#714).

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional
yearqueryoptional
period_daysqueryoptionalOptional rolling-window filter in days.

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/date-range

Get Date Range

Min/max realized-trade dates for the authenticated tenant.

Auth (#714): tenant_id is derived from the JWT claim. Admins may pass tenant_id to read another tenant; non-admins cannot.

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/drawdown

Compute Drawdown

Compute cumulative-PnL drawdown series for the authenticated tenant (#714).

#482 fixes:

  • Reject malformed date_sold rows — the legacy MTM tax-filing import contained strings like “Dec 29” + literal “Invalid Date” that polluted the series with phantom -80% drawdowns. The regex guard ^YYYY-MM-DD excludes them at the SQL layer.
  • Accept period_days so the 30d / 60d / 90d window buttons on the Performance Analysis page can actually filter the response; previously the frontend sliced the unbounded series client-side which was both slow and never reached the legacy rows that wedged the chart.
  • Drop the unsafe LEFT(date_sold, 4)::integer year filter in favor of the regex-validated date_sold::date comparison.

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional
yearqueryoptional
period_daysqueryoptionalOptional rolling-window filter — only include trades whose date_sold is within the last N days.

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/investor-allocation

Get Investor Allocation

Investor allocation breakdown for the authenticated tenant (#714).

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/pnl

Aggregate Pnl

P&L aggregate per period for the authenticated tenant (#714).

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional
periodquerystringoptionaldaily
yearqueryoptional
period_daysqueryoptionalOptional rolling-window filter in days.

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/analytics/xirr

Compute Xirr

Compute XIRR (irregular cash flow IRR) using Newton-Raphson. Returns annualized rate of return. None if no convergence.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/yoy

Yoy Summary

Year-over-year P&L summary for the authenticated tenant (#714). Includes pnl_growth_pct vs prior year and aum_growth_pct.

Parameters

NameInTypeRequiredDescription
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/market/refresh

Refresh Market Data

Fetch latest prices from yfinance and update daily_position_snapshots.

Parameters

NameInTypeRequiredDescription
symbolsquerystringoptionalComma-separated symbols to refresh
tenant_idqueryoptional
account_idqueryoptional
account_idsqueryoptional

Responses

CodeDescription
200Successful Response
422Validation Error