---
title: "Get a file tree"
method: POST
path: "/api/tree"
tags: ["Git"]
---

# Get a file tree

`POST /api/tree`

Returns the file tree for a repository at a given revision.

## Request body

- PublicGetTreeRequest
  - `repoName` string, required
  - `revisionName` string, required
  - `paths` string[], required

## Response `200`

File tree for the requested repository revision.

- object
  - `tree` PublicFileTreeNode, required
    - `type` string, required
    - `path` string, required
    - `name` string, required
    - `children` PublicFileTreeNode[], required

## Other responses

- `400` — Invalid request body or git ref.
- `404` — Repository or path not found.
- `500` — Unexpected tree retrieval failure.

---

[API](https://skmtc.dev/sourcebot/apis/sourcebot-public-api.md) · [All operations](https://skmtc.dev/sourcebot/apis/sourcebot-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sourcebot/sourcebot-public-api/revisions/b0ed96fb7103/schema)
