List Entities

GET /api/v1/entities

Returns transactions grouped by entity and type, with a count and inflow/outflow sum per group, over a date range. This provides the same data as the Entities page in the web UI, as flat rows (the UI additionally nests these into a type-grouped tree client-side).

Query Parameters

ParameterTypeRequiredDefaultDescription
date_fromstringYes-Start date (YYYY-MM-DD)
date_tostringYes-End date (YYYY-MM-DD)
accountsstringNoallComma-separated account IDs to filter
typestringNoallFilter by transaction type (income, expense, asset, liability, transfer, unknown)

Example Requests

curl -X GET "https://statements.finopsbricks.com/api/v1/entities?date_from=2024-01-01&date_to=2024-12-31" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"
curl -X GET "https://statements.finopsbricks.com/api/v1/entities?date_from=2024-01-01&date_to=2024-12-31&type=expense&accounts=acc123,acc456" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

Response

{
  "data": {
    "period": {
      "date_from": "2024-01-01",
      "date_to": "2024-12-31"
    },
    "data": [
      {
        "entity": "Acme Corp",
        "type": "expense",
        "count": 12,
        "inflow": 0,
        "outflow": 4500.00
      },
      {
        "entity": null,
        "type": "expense",
        "count": 3,
        "inflow": 0,
        "outflow": 320.00
      }
    ],
    "totals": {
      "count": 15,
      "inflow": 0,
      "outflow": 4820.00
    },
    "accounts": [
      {
        "id": "acc123",
        "name": "Main Business Account",
        "category": "bank"
      }
    ]
  }
}

Response Fields

period

FieldTypeDescription
date_fromstringStart date of the range
date_tostringEnd date of the range

data

Array of entity aggregates. One row per distinct entity + type pair found in the range.

FieldTypeDescription
entitystring | nullEntity name, or null for untagged transactions
typestringTransaction type of this group
countnumberNumber of transactions in this entity+type
inflownumberSum of inflow for this group
outflownumberSum of outflow for this group

totals

Aggregate across all matching transactions in the range (all entities, all types).

FieldTypeDescription
countnumberTotal matching transactions
inflownumberTotal inflow
outflownumberTotal outflow

accounts

Array of non-archived accounts available for filtering.

FieldTypeDescription
idstringAccount ID
namestringAccount name
categorystringAccount category (bank or credit_card)

Errors

CodeDescription
400Missing required parameters (date_from or date_to)
400Invalid date format (must be YYYY-MM-DD)
400date_from is after date_to
400Invalid type
401Invalid or missing API credentials
403API key lacks reports:read permission