Skip to main content

Documentation 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.

The /api/finance/budget-status endpoint compares each department’s actual expense against its budgeted amount for a single calendar month, returning the variance and percentage of budget consumed. It is designed for “which department is over budget?” and “how much of the Marketing budget is left?” questions. An important constraint is that this endpoint covers exactly one month at a time — it joins the budgets table (which stores one row per department per month) against actual transaction spend for that month, so there is no multi-month aggregation or annual roll-up.

Request

month
string
required
Any date within the target month in YYYY-MM-DD format. The query truncates this date to the first of the month internally, so 2025-06-15, 2025-06-01, and 2025-06-30 all return June 2025 data.
departments
string
Optional comma-separated list of department names to include in the response (e.g. Engineering,Marketing). Whitespace around commas is trimmed automatically. When omitted, all departments are returned.

Response

The response is an array of BudgetRow objects, one per department (or per filtered department if departments was supplied).
department
string
The department name.
budget
number
The budgeted expense amount for this department for the month.
actual
number
The actual total expense recorded for this department during the month.
variance
number
The difference between actual and budget: actual - budget. A positive variance means the department spent more than budgeted (over budget); a negative variance means it spent less (under budget).
pctUsed
number
The fraction of the budget consumed: actual / budget. A value of 1.0 means exactly 100% of the budget was used; 1.08 means 8% over budget; 0.944 means the department used only 94.4% of its budget.
This endpoint covers a single month only. There is no multi-month or annual budget aggregation. Pass any date within the target month — 2025-06-15 and 2025-06-01 both return June 2025.

Example

Request

curl "http://localhost:3000/api/finance/budget-status?month=2025-06-01"

Response

[
  {
    "department": "Engineering",
    "budget": 150000,
    "actual": 162000,
    "variance": 12000,
    "pctUsed": 1.08
  },
  {
    "department": "Marketing",
    "budget": 80000,
    "actual": 75500,
    "variance": -4500,
    "pctUsed": 0.944
  }
]

Filter to one department

curl "http://localhost:3000/api/finance/budget-status?month=2025-06-01&departments=Engineering"

Error Response

{
  "error": {
    "formErrors": [],
    "fieldErrors": {
      "month": ["Required"]
    }
  }
}

Build docs developers (and LLMs) love