Overview
Returns a detailed breakdown of API usage — investigations, events ingested, and API calls — for the current and optionally previous billing periods. Use this to build usage dashboards or track quota burn rate.
Required role: admin
JWT Bearer token. Format: Bearer <your-jwt>.
Query parameters
Billing period to query. One of: current, previous. Default: current.
Aggregate usage by dimension. One of: day, week. Default: no grouping.
Response
Returns 200 OK.
{
"period": "current",
"start": "2024-04-01T00:00:00Z",
"end": "2024-05-01T00:00:00Z",
"totals": {
"investigations": 142,
"events": 8420,
"apiCalls": 14230
},
"limits": {
"investigations": 500,
"events": 10000
},
"dailyBreakdown": [
{
"date": "2024-04-01",
"investigations": 12,
"events": 820,
"apiCalls": 1200
},
{
"date": "2024-04-02",
"investigations": 8,
"events": 430,
"apiCalls": 980
}
]
}
| Field | Type | Description |
|---|
period | string | Period queried: current or previous |
totals.investigations | integer | Total investigations run in this period |
totals.events | integer | Total events ingested in this period |
totals.apiCalls | integer | Total authenticated API calls in this period |
limits | object | Plan quota limits for this period |
dailyBreakdown | array | Per-day breakdown when groupBy=day is set |
Error responses
| Status | Error code | Description |
|---|
401 | unauthorized | Missing or invalid JWT |
403 | forbidden | Caller lacks admin role |
Examples
curl "https://api.causeflow.ai/v1/billing/usage?period=current&groupBy=day" \
-H "Authorization: Bearer eyJhbGc..."
Credits
View credit balance for overage coverage
Subscription
Upgrade your plan before quota exhaustion