---
title: "Get Directory Tree"
method: POST
path: "/api/filesystem/tree"
tags: ["filesystem"]
---

# Get Directory Tree

`POST /api/filesystem/tree`

Generates a tree representation of a directory structure.

## Request body

- TreeParams
  - `path` string, required — Root directory path
  - `max_depth` integer — Maximum depth to traverse
  - `include_hidden` boolean — Whether to include hidden files/directories
  - `pattern` string, nullable — Glob pattern to filter results

## Response `200`

Successfully generated directory tree

- object

## Other responses

- `403` — Permission denied
- `404` — Directory not found
- `422` — Validation Error
- `500` — Internal server error

## Changes

- **2026-07-13** `5424450258fc` — 1 info
  - endpoint added
- **2025-01-13** `a2d864f3a8db` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/cuse-dev/apis/fastapi/changes/api/filesystem/tree/post.md)

---

[API](https://skmtc.dev/cuse-dev/apis/fastapi.md) · [All operations](https://skmtc.dev/cuse-dev/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cuse-dev/fastapi/revisions/5424450258fc/schema)
