Get Account Statement Coverage
GET /api/v1/accounts/:id/coverage
Returns which days the account's uploaded statements cover, the days no statement covers, how current the account's data is, and the statements still being processed. This is the data behind the Statement Coverage timeline and the Missing Data list on the account page.
Path Parameters
| Parameter | Type | Description |
|---|
| id | string | Account ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|
| date_from | string | No | Window start (YYYY-MM-DD, inclusive) |
| date_to | string | No | Window end (YYYY-MM-DD, inclusive) |
Without a window, gaps run only between the first and last statement, as on the account page. With date_from and date_to, only statements whose period overlaps the window are considered, coverage is clipped to the window, and the days before the first statement and after the last are gaps too. Give both to check that a period is complete before a close.
Example Request
curl -X GET "https://statements.finopsbricks.com/api/v1/accounts/acc123xyz/coverage?date_from=2024-01-01&date_to=2024-03-31" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx"
Response
{
"data": {
"account_id": "acc123xyz",
"account_name": "Main Business Account",
"period": { "date_from": "2024-01-01", "date_to": "2024-03-31" },
"coverage": [
{ "start": "2024-01-01", "end": "2024-01-31" },
{ "start": "2024-03-01", "end": "2024-03-20" }
],
"gaps": [
{ "gap_start": "2024-02-01", "gap_end": "2024-02-29", "days": 29 },
{ "gap_start": "2024-03-21", "gap_end": "2024-03-31", "days": 11 }
],
"incomplete_statements": [
{
"id": "stm456abc",
"file_name": "march.pdf",
"period_start": "2024-03-01",
"period_end": "2024-03-20",
"step": "create_transactions"
}
],
"upload_status": {
"data_coverage_date": "2024-03-20",
"last_transaction_date": "2024-03-19",
"days_since": 12,
"status": "ok",
"upload_frequency": "monthly"
}
}
}
Response Fields
| Field | Type | Description |
|---|
| account_id | string | The account ID |
| account_name | string | The account name |
| period.date_from | string|null | The window start, or null without a window |
| period.date_to | string|null | The window end, or null without a window |
| coverage | array | Merged statement periods { start, end }, oldest first. Overlapping periods merge; adjacent ones (Jan 31, then Feb 1) are separate entries with no gap between them |
| gaps | array | Days no statement covers { gap_start, gap_end, days }, oldest first; days counts both ends |
| incomplete_statements | array | Statements not at the complete step (no transactions created yet): { id, file_name, period_start, period_end, step }. With a window, only those whose period overlaps it |
| upload_status.data_coverage_date | string|null | The later of the last transaction date and the last statement period end, across all the account's statements |
| upload_status.last_transaction_date | string|null | Date of the account's newest transaction |
| upload_status.days_since | number|null | Days from data_coverage_date to today |
| upload_status.status | string | ok, warning or overdue against the upload cadence |
| upload_status.upload_frequency | string | The account's upload cadence (default weekly) |
A statement counts as coverage whatever its step. Check incomplete_statements: a covered day whose statement is still processing has no transactions yet.
Errors
| Code | Description |
|---|
| 400 | date_from or date_to is not a YYYY-MM-DD date, or date_from is after date_to |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks accounts:read permission |
| 404 | Account not found |