Skip to main content

getTree

client.threads.getTree(threadId: string): Promise<ThreadGraphNode>

Retrieves the hierarchical tree structure for a thread.

Returns the complete tree representation starting from the specified thread, including all descendant threads and their relationships. This is useful for visualizing thread hierarchies and understanding nested thread structures.

Parameters

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the root thread

Returns

Promise<ThreadGraphNode> — A promise that resolves to a ThreadGraphNode representing the tree

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.threads.getTree('threadId');
console.log(result);