cURL
Endpoints
Drive Tree
Navigate the drive folder hierarchy as a nested tree.
GET
cURL
Documentation Index
Fetch the complete documentation index at: https://developer.copera.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Retrieves the hierarchical tree structure of files and folders in the drive. Items are returned as nested nodes with their children, up to a configurable depth. This is the primary endpoint for building a file explorer or navigation sidebar.Query Parameters
parentId(optional): Start the tree from this folder ID. Omit to get root-level items.depth(optional): Maximum nesting depth, 1-10. Defaults to 3.
Response
Returns a tree structure with:root: Array of top-level tree nodes, each with nestedchildrentotalItems: Total number of items in the responsetruncated: Whether the result was truncated (max 500 items)nextParentIds: When truncated, IDs of leaf folders that have more children — use these asparentIdto continue fetching
id: The file or folder IDname: Display nametype: Eitherfileorfolderchildren: Array of nested child nodeshasChildren: Boolean indicating whether this node has children beyond what was returned (useful for lazy loading)
Lazy Loading
For large drive structures, useparentId and depth together for lazy loading:
- Fetch the root tree with a shallow depth (e.g.,
depth=2) - When a user expands a folder, fetch its subtree using
parentId={folderId}&depth=2 - Use the
hasChildrenflag to show expand indicators in the UI
Authorizations
Bearer token
Query Parameters
Start tree from this folder. Omit for root-level contents.
Pattern:
^[0-9a-fA-F]{24}$Max nesting depth (1-10). Defaults to 3.
Required range:
1 <= x <= 10