Skip to content

GET /api/agent/forecast

Returns the latest ForecastSnapshot for the given scenario. Omit scenarioId to use the org's default BASE scenario.

Auth

  • Required scope: READ_FORECAST
  • Header: Authorization: Bearer cr_live_<prefix>_<secret>

Query parameters

NameTypeRequiredNotes
scenarioIdstringnoOptional scenario id. Defaults to the org's default BASE scenario.

Responses

200 — Serialised 13-week forecast

Body: ForecastResponse

FieldTypeRequiredNotes
scenarioIdstringyes
scenarioNamestringno
scenarioKindstring · one of BASE BEST WORST CUSTOMno
computedAtstring (date-time)yes
weeksarray of ForecastWeekyes
startingCashstringyes
endingCashstringyes
minClosingCashstringno
minClosingCashWeekIndexintegerno
totalInflowstringno
totalOutflowstringno
redactedItemCountintegeryesSum across all weeks of (week, account) pairs whose account name was rewritten to "Sensitive account" inside weeks[].categories.accounts[id].name for this caller. Always 0 when the key carries READ_SENSITIVE. The net cash trajectory (opening/inflow/outflow/closing) is never masked: a sensitive account's totals still feed weekly amounts (Stripe restricted-key pattern).
notesForAgentarray of AgentNoteno
billingAlertBillingAlertno
xeroAlertXeroAlertno

401 — Unauthorized

Body: ErrorResponse

FieldTypeRequiredNotes
errorstringyes

404 — Scenario doesn't belong to the org, or no snapshot exists yet

Body: ErrorResponse

FieldTypeRequiredNotes
errorstringyes

Response headers

Every successful response carries X-CashRunway-Subscription, X-CashRunway-Plan, X-CashRunway-Quota-Remaining, and X-CashRunway-Quota-Reset. Trialing subscriptions also include X-CashRunway-Trial-Days-Remaining. See the overview for details.

Released under a proprietary license.