GET /api/agent/expenses/summary
AP-side mirror of /api/agent/revenue/summary. Same shape, same parameters, same reconciliation semantics. Use FIRST for any 'monthly expense burn?', 'top suppliers by spend?', 'who are we paying the most?' question - 50x token savings vs paging through /api/agent/bills. PAID values are ex-GST (cash-basis) per the bill-side line splitter.
Auth
- Required scope:
READ_SUMMARY - Header:
Authorization: Bearer cr_live_<prefix>_<secret>
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
dateFrom | string | no | |
dateTo | string | no | |
topN | integer | no |
Responses
200 — Aggregate expense summary
Body: ExpensesSummaryResponse
| Field | Type | Required | Notes |
|---|---|---|---|
asOfDate | string (date) | yes | |
currency | string | yes | |
window | object | yes | |
grandTotal | SummaryBucket | yes | |
byStatus | object | yes | |
byMonth | array of SummaryMonthBucket | yes | |
topContacts | array of SummaryTopContact | yes | |
redactedItemCount | integer | yes | |
billingAlert | BillingAlert | no | |
xeroAlert | XeroAlert | no |
401 — Unauthorized
Body: ErrorResponse
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
403 — Key lacks the required scope
Body: ErrorResponse
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
429 — Rate-limited or quota-exhausted
Body: ErrorResponse
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
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.