GET /api/agent/orgs/{orgId}/daily-brief
Returns the latest DailyAgentBrief row for the caller's org. The dashboard view and the agentic API read the same row, so an LLM agent and the human user always see the same brief at any given moment.
A daily worker (daily-agent-brief.scheduler) regenerates the row once per UTC day per active org. The free tier is rules-based; the premium tier is LLM-generated. The shape of the response is identical across tiers.
Auth
- Required scope: any authenticated key (no specific scope required)
- Header:
Authorization: Bearer cr_live_<prefix>_<secret> - Cross-tenant: the bearer's resolved
orgIdmust match the path{orgId}. Mismatches return403.
Path parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
orgId | path | string | yes | Org id; must match the bearer's org id. |
Responses
200 — Latest daily brief
Body: DailyBriefResponse
| Field | Type | Required | Notes |
|---|---|---|---|
orgId | string | yes | Echoes the path param. |
asOfDate | string (date) | yes | UTC business day the brief was generated for (YYYY-MM-DD). |
generatedAt | string (date-time) | yes | When the row was written. |
generatorTier | string · one of rules llm | yes | Which generator produced the payload. |
payload | DailyBriefPayload | yes | The three-section brief — see schema below. |
401 — Unauthorized
Body: ErrorResponse
Returned for missing bearer, bad token prefix, or revoked key. Causes are not differentiated — that would leak prefix existence.
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
403 — Cross-tenant forbidden
Body: ErrorResponse
The bearer authenticated, but the resolved orgId doesn't match the {orgId} path segment. Cross-tenant reads are never allowed.
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
404 — No brief generated yet
Body: ErrorResponse with error: "no_brief_yet"
Typically the first day after onboarding, before the daily cron has fanned out. Retry after the next 06:00 UTC tick.
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes | "no_brief_yet" for this code. |
Example
curl -sS "https://app.cashrunway.ai/api/agent/orgs/$ORG_ID/daily-brief" \
-H "Authorization: Bearer $CASHRUNWAY_API_KEY" | jq{
"orgId": "org_01HX…",
"asOfDate": "2026-05-08",
"generatedAt": "2026-05-08T06:00:14.221Z",
"generatorTier": "rules",
"payload": {
"mainDriver": {
"headline": "Apex + Brightline drive 64% of W1–4 inflows",
"bodyMarkdown": "Two customers shape the green side of the next month: **Apex Electrical** ($320k, due W3) and **Brightline Controls** ($210k, due W4).",
"refs": [
{ "kind": "customer", "key": "apex-electrical", "displayName": "Apex Electrical" },
{ "kind": "customer", "key": "brightline-controls", "displayName": "Brightline Controls" }
]
},
"riskSignal": {
"headline": "W9 dips to A$278k",
"bodyMarkdown": "Conservative cash crosses your minimum buffer in **W9** under current assumptions.",
"refs": [{ "kind": "week", "weekNumber": 9 }]
},
"recommendedAction": {
"headline": "Bring Metro Lighting forward by 1 week",
"bodyMarkdown": "Pulling **Metro Lighting**'s W9 invoice into W8 keeps the conservative line above buffer for the full 13 weeks.",
"refs": [{ "kind": "customer", "key": "metro-lighting", "displayName": "Metro Lighting" }]
}
}
}Schemas
DailyBriefPayload
Three-section brief with cross-link refs the dashboard hover system uses to highlight the matching card / column / row.
| Field | Type | Required | Notes |
|---|---|---|---|
mainDriver | BriefSection | yes | What's shaping the green side. |
riskSignal | BriefSection | yes | Weakest week / biggest risk. |
recommendedAction | BriefSection | yes | One concrete move for this week. |
BriefSection
| Field | Type | Required | Notes |
|---|---|---|---|
headline | string | yes | ≤ 80 chars. Plain string, no markdown. |
bodyMarkdown | string | yes | Body paragraph; supports basic markdown (**bold**, *italic*). |
refs | array of BriefRef | yes | Cross-link refs. Empty array is valid. |
BriefRef
A discriminated union — exactly one of:
| Variant | Fields | Notes |
|---|---|---|
| customer | kind: "customer", key: string, displayName: string | Customer slug + display label. |
| category | kind: "category", key: string, displayName: string | Spend-category slug + label. |
| week | kind: "week", weekNumber: integer | 1-indexed within the 13-week window. |
Notes
- The endpoint is read-only. Regeneration is worker-driven; clients don't trigger it.
- The brief is keyed
(orgId, asOfDate). Calling within the same UTC business day always returns the same row. - This endpoint is not yet listed in the OpenAPI spec at
/api/agent/openapi.json— it'll join the auto-generated reference once tier semantics for thepayload.refscross-link contract are pinned. Until then, treat this page as the canonical contract.