Documentation Tree
GET
/api/v1/content/docs/treeOverview
Returns the full hierarchical documentation tree structure. Use this to build documentation sidebars and navigation. The tree is recursive -- sections can contain other sections and doc pages.
Authentication
info
No authentication required - Client is resolved from the X-Content-Domain header, which the Cloudflare Worker sets automatically based on the request domain.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-Content-Domain | string | Yes | The domain used to resolve the client tenant. Automatically set by the CF Worker; set manually for external frontend integrations. |
Response
treearrayArray of top-level tree nodes (recursive)
tree[].idstring (UUID)Unique node identifier
tree[].slugstringURL-friendly slug for this node
tree[].full_pathstringFull path from root (e.g., api/authentication/oauth)
tree[].titlestringDisplay title
tree[].is_sectionbooleantrue for section nodes (containers), false for doc pages
tree[].sort_orderintegerSort order within the parent level
tree[].childrenarrayNested child nodes (recursive, same shape)
Example Request
- cURL
- Python
- JavaScript
curl -s "https://spideriq.ai/api/v1/content/docs/tree" \
-H "X-Content-Domain: your-domain.com"
import requests
resp = requests.get(
"https://spideriq.ai/api/v1/content/docs/tree",
headers={"X-Content-Domain": "your-domain.com"}
)
data = resp.json()
def print_tree(nodes, indent=0):
for node in nodes:
prefix = " " * indent
marker = "[section]" if node["is_section"] else "[doc]"
print(f"{prefix}{marker} {node['title']} ({node['full_path']})")
if node.get("children"):
print_tree(node["children"], indent + 1)
print_tree(data["tree"])
const resp = await fetch(
"https://spideriq.ai/api/v1/content/docs/tree",
{ headers: { "X-Content-Domain": "your-domain.com" } }
);
const data = await resp.json();
function printTree(nodes, indent = 0) {
for (const node of nodes) {
const prefix = " ".repeat(indent);
const marker = node.is_section ? "[section]" : "[doc]";
console.log(`${prefix}${marker} ${node.title} (${node.full_path})`);
if (node.children?.length) printTree(node.children, indent + 1);
}
}
printTree(data.tree);
Example Response
{
"tree": [
{
"id": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
"slug": "getting-started",
"full_path": "getting-started",
"title": "Getting Started",
"is_section": true,
"sort_order": 0,
"children": [
{
"id": "f2a3b4c5-d6e7-8901-bcde-f12345678901",
"slug": "quickstart",
"full_path": "getting-started/quickstart",
"title": "Quickstart Guide",
"is_section": false,
"sort_order": 0,
"children": []
},
{
"id": "a3b4c5d6-e7f8-9012-cdef-123456789012",
"slug": "authentication",
"full_path": "getting-started/authentication",
"title": "Authentication",
"is_section": false,
"sort_order": 1,
"children": []
}
]
},
{
"id": "b4c5d6e7-f8a9-0123-defg-234567890123",
"slug": "api",
"full_path": "api",
"title": "API Reference",
"is_section": true,
"sort_order": 1,
"children": [
{
"id": "c5d6e7f8-a9b0-1234-efgh-345678901234",
"slug": "authentication",
"full_path": "api/authentication",
"title": "Authentication",
"is_section": true,
"sort_order": 0,
"children": [
{
"id": "d6e7f8a9-b0c1-2345-fghi-456789012345",
"slug": "oauth",
"full_path": "api/authentication/oauth",
"title": "OAuth 2.0",
"is_section": false,
"sort_order": 0,
"children": []
}
]
}
]
}
]
}
Status Codes
| Status Code | Meaning | Description |
|---|---|---|
| 200 | OK | Documentation tree returned successfully |