Skip to main content

Endpoint

GET /api/content/:productSlug/nav-data/:version/:section
Fetches the navigation tree for a specific section of a product’s documentation. dev-portal uses this to build the sidebar menu shown alongside documentation pages. The route resolves to a <section>-nav-data.json file in the product’s versioned content directory under data/.

Path parameters

productSlug
string
required
The slug identifying the product.Examples: terraform-plugin-framework, terraform-enterprise
version
string
required
The documentation version. Use latest to resolve to the most recent stable version.Examples: latest, v1.9.x
section
string
required
The section name corresponding to a nav data file. The server looks up content/<productSlug>/<version>/data/<section>-nav-data.json.Examples: docs, cli, plugin

Example requests

curl http://localhost:8080/api/content/terraform-plugin-framework/nav-data/latest/docs

Response

Returns a JSON object with a result containing the navData array. Each element is a nav item that may have nested children.
200
{
  "result": {
    "navData": [
      {
        "title": "Overview",
        "path": "plugin/framework"
      },
      {
        "title": "Getting Started",
        "routes": [
          {
            "title": "Code Walkthrough",
            "path": "plugin/framework/getting-started/code-walkthrough"
          }
        ]
      },
      {
        "divider": true
      }
    ]
  }
}

Response fields

result
object
required

Response headers

HeaderDescription
content-typeAlways application/json
served-fromIndicates whether content was served from current build or production

How nav data files are structured

Nav data files live at content/<productSlug>/<version>/data/<section>-nav-data.json in the repository. They are plain JSON arrays following the nav item schema described above.
content/
  terraform-plugin-framework/
    v1.10.x/
      data/
        docs-nav-data.json
        plugin-nav-data.json

Error responses

StatusBodyCause
404Not foundThe productSlug or version could not be resolved, or no nav data file exists for the requested section.

Build docs developers (and LLMs) love