---
title: "Get aggregate portfolio history across all of a user’s wallets"
method: GET
path: "/v1/portfolio/history/by-user"
tags: ["portfolio"]
---

# Get aggregate portfolio history across all of a user’s wallets

`GET /v1/portfolio/history/by-user`

## Request

- Base URL: `https://app.legend.trade/api/rest`
- URL: `https://app.legend.trade/api/rest/v1/portfolio/history/by-user`
- Auth: HTTP bearer

## Query parameters

- `userId` string, uuid, required
- `network` 'hyperliquid_mainnet' | 'hyperliquid_testnet'
- `days` integer
- `minutes` integer
- `metricType` 'accountValue' | 'pnl'
- `includePositions` boolean
- `includePositionSymbols` boolean
- `includeAutocopyTraders` boolean

## Response `200`

Successful response

- object
  - `history` object[], required
    - `time` number, required
    - `value` number, required
    - `positions` object[], required
      - `symbol` string, required
      - `size` number, nullable, required
      - `entry_price` number, nullable, required
      - `unrealized_pnl` number, nullable, required
      - `leverage_type` string, nullable, required
      - `leverage_value` number, nullable, required
      - `position_value` number, nullable, required
      - `margin_used` number, nullable, required
    - `position_symbols` string[]
    - `autocopy_trader_ids` string[]
  - `autocopy_traders` object[]
    - `id` string, required
    - `username` string, nullable, required
    - `display_name` string, nullable, required
    - `avatar_url` string, nullable, required

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `404`: Not found
- `500`: Internal server error

## Changes

- **2026-10-25** `8d368659667e`: 10 breaking, 10 info
  - the response property `autocopy_traders/items/avatar_url` became nullable for the status `200`
  - the response property `autocopy_traders/items/display_name` became nullable for the status `200`
  - the response property `autocopy_traders/items/username` became nullable for the status `200`
  - the response property `history/items/positions/items/entry_price` became nullable for the status `200`
  - …16 more
- **2026-10-01** `891b62f9fe9d`: 3 info
  - added the new optional `query` request parameter `includeAutocopyTraders`
  - added the optional property `autocopy_traders` to the response with the `200` status
  - added the optional property `history/items/autocopy_trader_ids` to the response with the `200` status
- **2026-09-08** `fae004332dd6`: 1 info
  - added the new optional `query` request parameter `network`
- **2026-08-30** `dbe693d00cb3`: 1 info
  - added the new optional `query` request parameter `minutes`

[Operation history](https://skmtc.dev/legend/apis/legend-api/changes/v1/portfolio/history/by-user/get.md)

---

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