---
title: "Api Portfolio History"
method: GET
path: "/api/portfolio-history"
tags: ["Portfolio"]
---

# Api Portfolio History

`GET /api/portfolio-history`

## Request

- Base URL: `https://www.oxfordledge.com` (the document declares no server; this is the origin it was published from)
- URL: `https://www.oxfordledge.com/api/portfolio-history`
- Auth: none declared

Portfolio snapshots over time — requires auth.

## Query parameters

- `days` integer: Number of days of history to return (1-3650)

## Response `200`

Successful Response

- PortfolioHistoryResponse: `GET /api/portfolio-history` response. F4 schema addition (2026-04-30): `snapshots` REQUIRED. Both 200 success and 500 fallback include `{snapshots: [...]}` (the 500 path adds an `error` string but keeps `snapshots`). Frontend portfolio-history chart iterates `data.snapshots.forEach(...)` to plot the equity curve.
  - `snapshots` PortfolioSnapshot[], required
    - `date` string, nullable
    - `totalValue` number, nullable
    - `cashValue` number, nullable
    - `pnl` number, nullable
    - `pnlPct` number, nullable
  - `error` string, nullable

## Other responses

- `401`: Unauthorized
- `422`: Validation Error

---

[API](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api.md) · [All operations](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/revisions/e832a1260f0b?raw)
