---
title: "Get document as tree structure"
method: GET
path: "/v1/documents/{id}/tree"
tags: ["documents"]
---

# Get document as tree structure

`GET /v1/documents/{id}/tree`

Returns the complete hierarchical tree structure with nested children. Useful for visualizing or navigating the document structure.

## Path parameters

- `id` string, required

## Response `200`

Document tree

- TreeNode
  - `id` string
  - `title` string
  - `summary` string — LLM-generated summary
  - `depth` integer — Depth in the tree (0 = root)
  - `is_leaf` boolean
  - `children` TreeNode[] — Child nodes (recursive structure)

## Other responses

- `404` — Document not found
- `500` — Storage error

---

[API](https://skmtc.net/brainfish-ai/apis/reasondb-api.md) · [All operations](https://skmtc.net/brainfish-ai/apis/reasondb-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/brainfish-ai/reasondb-api/versions/f8665c1a5239/schema)
