---
title: "Thread tree"
method: GET
path: "/chat/tree"
tags: ["chat"]
---

# Thread tree

`GET /chat/tree`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/chat/tree`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Read the parent-child chat thread hierarchy.

## Query parameters

- `titleQuery` string: Filter threads by title.
- `limit` integer
- `includeArchived` boolean
- `includeAutomated` boolean: Include routine-spawned threads. Defaults false.

## Response `200`

Successful response

- object[]: Flat thread rows; parentThreadId encodes the hierarchy.
  - `threadId` string, required
  - `title` string, required
  - `lastMessageAt` number, required
  - `createdAt` number, required
  - `status` 'idle' | 'streaming' | 'error', required
  - `visibility` 'private' | 'shared', required
  - `createdByUserId` string, required
  - `archivedAt` number, nullable, required
  - `fileContextPath` string, nullable, required
  - `parentThreadId` string, nullable, required: Parent thread when this is a spawned sub-agent.
  - `nestingDepth` number, nullable, required
  - `summary` string, nullable, required
  - `activeRunId` string, nullable, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
