Skip to content

Get Grid Endpoint

GET
/api/v1/snapshots/grid
curl --request GET \
--url 'https://example.com/api/v1/snapshots/grid?offset=0&sort_by=date&sort_dir=asc'

Pivoted grid data: dates as rows, accounts as columns.

date_from/date_to are optional query params bounding the snapshot date range; omitting either (or both) is unbounded, matching prior behavior.

limit/offset paginate by distinct date, not by snapshot row – a page always contains every account’s cell for each date it includes, never a partial one. Always returns X-Total-Count (total distinct dates matching date_from/date_to, ignoring limit/offset). Omitting limit returns every matching date, unbounded, matching prior behavior exactly – unaffected by which column is sorted on, still reporting the row count as its total, never gaining a slice.

sort_by/sort_dir/sort_column_id mirror the institutions grid’s contract exactly: date (unchanged, SQL-paginated), row total, or one account’s own raw balance, ordered across the whole matching date range (not just the loaded page) for total/column sorts. This endpoint has no pre-existing router-layer column list, so it resolves one via get_grid_account_ids() before validating and before fetching, and passes that same list down to the grid builder as its column order – the validated set and the rendered columns can never disagree. sort_column_id, when the column mode is requested, must name one of those resolved account ids; anything else (foreign, or matching no account at all) is rejected with a 422 that names the constraint only, indistinguishably. Supplying sort_column_id with any other mode is ignored rather than rejected. Omitting all three sort params reproduces the pre-existing row order and total-count header exactly, in both the paginated and the unbounded case.

date_from
Any of:
string format: date
date_to
Any of:
string format: date
limit
Any of:
integer
>= 1 <= 250
offset
Offset
integer
0
sort_by
Sort By
string
default: date
Allowed values: date total column
sort_dir
Sort Dir
string
default: desc
Allowed values: asc desc
sort_column_id
Any of:
integer

Successful Response

Media typeapplication/json
Response Get Grid Endpoint Api V1 Snapshots Grid Get
Array<object>
GridRow

One date row in the pivoted grid.

cells has one GridCell per active account, in account order. total is the base-currency-converted sum of non-null cell balances (Decimal serialized as string) – NOT a naive raw sum of native balances, which would be wrong whenever cells span multiple currencies. A cell whose currency has no resolvable conversion rate contributes 0 to this total, matching the existing aggregate-total fallback convention used elsewhere (e.g. SnapshotDateGroup’s total).

object
date
required
Date
string
cells
required
Cells
Array<object>
GridCell

One account’s data within a grid row.

null snapshot_id/balance means no snapshot for this account on this date. currency/converted_balance are null only when balance is null. converted_balance is the base-currency-converted amount when the snapshot’s own currency differs from the user’s base_currency; it is null when currency == base_currency (nothing to convert) OR when no conversion rate could be resolved at all for that currency (genuinely absent from history, not “still loading” – the frontend renders a warning icon in that case rather than a misleading converted figure).

object
account_id
required
Account Id
integer
snapshot_id
required
Any of:
integer
balance
required
Any of:
string
currency
Any of:
string
converted_balance
Any of:
string
total
required
Total
string

Example generated

[
{
"date": "example",
"cells": [
{
"account_id": 1,
"snapshot_id": 1,
"balance": "example",
"currency": "example",
"converted_balance": "example"
}
],
"total": "example"
}
]

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}