---
title: "Spend rolled up across a wallet's account subtree"
method: GET
path: "/wallets/tree"
---

# Spend rolled up across a wallet's account subtree

`GET /wallets/tree`

## Request

- Base URL: `https://getsanction.com/api/v1`
- URL: `https://getsanction.com/api/v1/wallets/tree`
- Auth: API key in header `x-mgmt-key`

Read-only. Returns the wallet and its descendant sub-accounts, each with its own spend and the rolled-up total of its whole subtree — one number for the fleet. Bounded depth/size. Management-plane.

## Query parameters

- `wallet_id` string, required

## Response `200`

Subtree with rolled-up spend

- WalletTreeResponse
  - `wallet_id` string
  - `nodes` integer: Number of wallets in the returned subtree.
  - `truncated` boolean: True if the subtree hit the depth/node cap.
  - `tree` AccountTreeNode: A wallet node with its own spend and the rolled-up total of its whole subtree.
    - `id` string
    - `name` string
    - `parent_id` string, nullable
    - `spend` SpendSummary
      - `today_usd` number
      - `month_usd` number
      - `token_today_usd` number
    - `rollup` SpendSummary
      - `today_usd` number
      - `month_usd` number
      - `token_today_usd` number
    - `children` AccountTreeNode[]

## Other responses

- `401`: Missing or invalid management key

---

[API](https://skmtc.dev/getsanction/apis/sanction-agent-governance-api.md) · [All operations](https://skmtc.dev/getsanction/apis/sanction-agent-governance-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getsanction/apis/sanction-agent-governance-api/revisions/c645a9e4b72d?raw)
