---
title: "The money records older than the snapshot’s window"
method: GET
path: "/api/v1/portfolio/history"
tags: ["Portfolio"]
---

# The money records older than the snapshot’s window

`GET /api/v1/portfolio/history`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/portfolio/history`
- Auth: API key in cookie `better-auth.session_token`

The portfolio a browser is given holds every open item and the last two calendar years of invoices, payments, bank movements and their matches. A screen that looks further back — a lease’s whole ledger, a bank account’s movements, a past year’s figures — reads that scope here and holds it beside the snapshot. What comes back is closed over its own links: a payment arrives with the invoices it paid and the movement it came off, so nothing names a record that is not here.

## Query parameters

- `lease` string
- `contact` string
- `bankAccount` string
- `from` string
- `to` string

## Response `200`

Every record in that scope.

- object
  - `ok` unknown, required
  - `data` object, required
    - `invoices` object, required
    - `payments` object, required
    - `bankTransactions` object, required
    - `reconciliationMatches` object, required
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `400`: No scope, more than one, or a period missing an end.

---

[API](https://skmtc.dev/dardaris/apis/dardaris-api.md) · [All operations](https://skmtc.dev/dardaris/apis/dardaris-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dardaris/apis/dardaris-api/revisions/4aff33835c73?raw)
