> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olonjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/public-page — fetch a rendered page bundle

> GET /api/public-page/[...slug] returns the fully resolved JSON page bundle for any page by slug, including baked section data and collection references.

The `GET /api/public-page/[...slug]` endpoint returns the fully resolved page bundle for a given slug. The bundle includes the page's `id`, `slug`, `meta` object, and a `sections` array in which all `$ref` pointers and collection bindings have been resolved to concrete data. Use this endpoint to fetch page data from external tools, preview environments, AI agents, or any client that needs structured content without running a full Next.js render.

## Request

* **Method:** `GET`
* **Path:** `/api/public-page/[...slug]`
* **Authentication:** None required

<ParamField path="slug" type="string" required>
  The page slug as a catch-all path segment. For top-level pages, use the page's slug directly (e.g., `about`). For nested pages, separate segments with `/` (e.g., `posts/write-the-readme-first`).
</ParamField>

```bash theme={null}
# Fetch the About page
curl https://your-site.com/api/public-page/about

# Fetch an individual post
curl https://your-site.com/api/public-page/posts/write-the-readme-first
```

## Response

**200 OK** — Returns the fully resolved page bundle as JSON.

<ResponseField name="id" type="string">
  The unique identifier for the page, matching the page's filename key in `src/data/pages/`.
</ResponseField>

<ResponseField name="slug" type="string">
  The URL slug for the page (e.g., `"about"` or `"posts/write-the-readme-first"`).
</ResponseField>

<ResponseField name="meta" type="object">
  SEO metadata object for the page, including `title`, `description`, and optional `ogImage`.
</ResponseField>

<ResponseField name="sections" type="array">
  Array of fully resolved section objects. All `$ref` pointers and collection bindings are expanded to their concrete values — exactly as served to the Next.js page component.
</ResponseField>

```json theme={null}
{
  "id": "about-page",
  "slug": "about",
  "meta": {
    "title": "About Inkwell Journal and this collections demo",
    "description": "Inkwell Journal is a working OlonJS demo: posts and tags live as separate collections, related through keys on the post side and resolved at render time."
  },
  "sections": [
    {
      "id": "global-header",
      "type": "header",
      "data": {
        "logoText": "Inkwell",
        "logoHighlight": "journal",
        "menu": [
          { "id": "nav-posts", "label": "Posts", "href": "/posts" },
          { "id": "nav-about", "label": "About", "href": "/about" }
        ]
      },
      "settings": { "sticky": true }
    },
    {
      "id": "about-hero",
      "type": "page-hero",
      "data": {
        "label": "About",
        "title": "A journal that is also a diagram",
        "description": "Inkwell exists to show one architectural idea clearly: entities as collections, relations as keys, and rendering as resolution."
      },
      "settings": { "paddingTop": "xl" }
    },
    {
      "id": "global-footer",
      "type": "footer",
      "data": {
        "brandText": "Inkwell",
        "copyright": "© 2026 Inkwell Journal. Written slowly, shipped quietly."
      },
      "settings": {}
    }
  ]
}
```

## Error responses

| Status | Meaning |
| - | - |
| `404` | No page exists for the given slug. Check that the slug matches a file in `src/data/pages/`. |
| `500` | An unexpected server error occurred while resolving the page bundle. The response body includes an `error` string with details. |

<Note>
  The response body is identical to the bundle that OlonJS passes to the visitor-facing Next.js route component. Consuming this endpoint gives you the same fully-baked data structure that drives the live rendered page.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.