> ## Documentation Index
> Fetch the complete documentation index at: https://docs.legend.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Folio

> Get a sub-account's portfolio (balances and positions)

# Get Folio

Returns the sub-account's portfolio, including wallet balances and DeFi positions across all networks.

## Request

```
GET /accounts/:account_id/folio
GET /accounts/:account_id/folio?cached=true
```

### Path parameters

| Parameter    | Type   | Description        |
| ------------ | ------ | ------------------ |
| `account_id` | string | The sub-account ID |

### Query parameters

| Parameter | Type    | Default | Description                                                                                                        |
| --------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
| `cached`  | boolean | `false` | If `true`, return the most recent cached folio instead of computing a fresh one. Faster but may be slightly stale. |

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://prime-api.legend.xyz/accounts/acc_2o0yiljtp378/folio \
    -H "Authorization: Bearer $LEGEND_QUERY_KEY"
  ```

  ```typescript TypeScript theme={null}
  const folio = await client.accounts.folio("acc_2o0yiljtp378");

  // Or use cached for faster response
  const cached = await client.accounts.folio("acc_2o0yiljtp378", { cached: true });
  ```

  ```python Python theme={null}
  folio = await client.accounts.folio("acc_2o0yiljtp378")

  # Or use cached for faster response
  cached = await client.accounts.folio("acc_2o0yiljtp378", cached=True)
  ```

  ```rust Rust theme={null}
  use legend_client::FolioOpts;

  let folio = client.accounts.folio("acc_2o0yiljtp378", &FolioOpts::default()).await?;
  ```
</CodeGroup>

```json Response theme={null}
{
  "folio": {
    ...
  }
}
```

<Note>
  A fresh folio requires reading on-chain state across multiple networks. This can take 10-30 seconds. Use `cached=true` when you need a fast response and can tolerate slightly stale data.
</Note>

## Errors

| Status | Code                | Description                                     |
| ------ | ------------------- | ----------------------------------------------- |
| 404    | `account_not_found` | Account doesn't exist                           |
| 408    | `timeout`           | Folio computation timed out (try `cached=true`) |
