Skip to main content

Documentation Tree

GET/api/v1/content/docs/tree

Overview

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

HeaderTypeRequiredDescription
X-Content-DomainstringYesThe domain used to resolve the client tenant. Automatically set by the CF Worker; set manually for external frontend integrations.

Response

treearray

Array of top-level tree nodes (recursive)

tree[].idstring (UUID)

Unique node identifier

tree[].slugstring

URL-friendly slug for this node

tree[].full_pathstring

Full path from root (e.g., api/authentication/oauth)

tree[].titlestring

Display title

tree[].is_sectionboolean

true for section nodes (containers), false for doc pages

tree[].sort_orderinteger

Sort order within the parent level

tree[].childrenarray

Nested child nodes (recursive, same shape)

Example Request

curl -s "https://spideriq.ai/api/v1/content/docs/tree" \
-H "X-Content-Domain: your-domain.com"

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 CodeMeaningDescription
200OKDocumentation tree returned successfully