TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/astrxnomo/financial-analytics-agent/llms.txt
Use this file to discover all available pages before exploring further.
/api/finance/anomalies endpoint detects statistically unusual expense transactions using a per-category baseline. For each expense category in the date range, the endpoint computes the mean and standard deviation of all transaction amounts within that category. Any individual transaction whose amount exceeds mean + (threshold × stddev) is flagged as an anomaly. The default threshold is 2.5 standard deviations, which catches genuine outliers while filtering out normal month-to-month variation. Lowering the threshold (e.g. to 2) surfaces more anomalies; raising it (e.g. to 3 or above) restricts results to only the most extreme cases.
Request
Start of the date range in
YYYY-MM-DD format. Inclusive.End of the date range in
YYYY-MM-DD format. Inclusive.Standard deviation multiplier used to determine the anomaly cutoff. A transaction is flagged when its amount exceeds
categoryMean + threshold × categoryStdDev. Must be between 1 and 6. Defaults to 2.5.Optional comma-separated list of department names. When provided, only anomalies from those departments are returned. Example:
Engineering,Operations.Optional comma-separated list of category names. When provided, only anomalies in those categories are returned. Example:
Travel,Office.The statistical baseline (mean and standard deviation) is always computed from all transactions in the full date range, regardless of the
departments or categories filters. Those filters only narrow the list of returned anomalies, not the data used to calculate the baseline. This preserves statistical validity — filtering the baseline to a single department would distort the distribution and produce different (less meaningful) σ values.Response
The response is an array ofAnomaly objects sorted by amount descending — the largest outliers appear first.
The transaction ID from the database.
The transaction date in
YYYY-MM-DD format.The transaction amount.
The department that incurred the transaction.
The expense category of the transaction.
The human-readable transaction description (e.g.
"Annual cloud infrastructure migration").The mean expense amount for this category across all transactions in the date range. Used as the baseline for the anomaly calculation.
The standard deviation of expense amounts for this category across all transactions in the date range.
(amount - categoryMean) / categoryStdDev. The chat UI displays this as a “Nσ” label (e.g. “3.2σ above average”) using the fmtSigma formatter from app/_components/charts.ts.