Skip to main content
GET
/
tree
/
{slug}
curl 'https://fetch-<project-token>.frontic.com/tree/<tree-slug>?key=<starting-node>&depth=2' \
  -H 'fs-context: <context-key>'
{
  "key": "shop",
  "name": "Shop",
  "link": {
    "slug": "shop",
    "path": "/en/shop",
    "url": "<your-shop>/en/shop",
    "href": "https://<your-shop>/en/shop"
  },
  "$children": [
    {
      "key": "women",
      "name": "Women",
      "link": {
        "slug": "shop/women",
        "path": "/en/shop/women",
        "url": "<your-shop>/en/shop/women",
        "href": "https://<your-shop>/en/shop/women"
      },
      "$children": []
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.frontic.com/llms.txt

Use this file to discover all available pages before exploring further.

Preview — Menu Trees are under active development and not yet exposed in the public Fetch API source. The endpoint shape below is the planned route based on the Client SDK and Nuxt module contracts; the actual HTTP surface may still evolve. The SDK and Nuxt calls are stable — prefer those today.
Fetch a Menu Tree — a hierarchical collection of records assembled from a Data Storage using parentKey and position defaults, with each node rendered through a Detail Block.

Path Parameters

project-token
string
required
Your project’s Fetch token, embedded in the subdomain.
slug
string
required
The tree’s slug, e.g. <tree-slug>. Per project — see your tree’s detail view in the API Builder.

Query Parameters

key
string
Optional starting node. When provided, the response returns the node with this key plus its descendants. Without a key, the full tree from the root is returned.
depth
integer
Optional level limit. Controls how many levels of $children are included. Without it, all levels are returned (subject to the 1,000-node cap).

Headers

See Headers on the overview for the full set. Trees honour fs-context, fs-domain, fs-version, and fs-secret (only when the project has fetch keys configured).

Response

The response body is the tree root (or the node identified by key), with $children recursively containing each subtree. Each node’s shape (beyond $children) is defined by the tree’s connected Detail Block. A single response is capped at 1,000 nodes total. When a level wouldn’t fit within the budget, the entire level is omitted (partial levels are never returned) and a warning is included in the response header.

Status codes

CodeWhen
200Tree (or subtree) returned
401fs-secret missing or wrong (only when the project has fetch keys configured)
404Tree slug doesn’t exist, or key doesn’t match a node
403Project’s plan limit for Fetch API requests exceeded
curl 'https://fetch-<project-token>.frontic.com/tree/<tree-slug>?key=<starting-node>&depth=2' \
  -H 'fs-context: <context-key>'
{
  "key": "shop",
  "name": "Shop",
  "link": {
    "slug": "shop",
    "path": "/en/shop",
    "url": "<your-shop>/en/shop",
    "href": "https://<your-shop>/en/shop"
  },
  "$children": [
    {
      "key": "women",
      "name": "Women",
      "link": {
        "slug": "shop/women",
        "path": "/en/shop/women",
        "url": "<your-shop>/en/shop/women",
        "href": "https://<your-shop>/en/shop/women"
      },
      "$children": []
    }
  ]
}