GET /api/pages

List all available pages in the CMS.

Description

This endpoint returns a complete list of all pages currently published in the Grav CMS, including their routes, titles, and metadata. This is the foundation of the self-documenting API - the system lists its own content structure.

Request

GET https://api.infinity.b0x.store/api/pages.json

Response Format

Success (200 OK)

{
  "pages": [
    {
      "route": "/api",
      "title": "GROOV API - Self-Documenting Grav CMS",
      "slug": "api",
      "visible": true,
      "published": true,
      "date": "2025-12-04T00:00:00Z",
      "modified": "2025-12-04T20:33:00Z",
      "template": "default"
    },
    {
      "route": "/api/pages",
      "title": "Pages Endpoint - List All Content",
      "slug": "pages",
      "visible": true,
      "published": true,
      "date": "2025-12-04T00:00:00Z",
      "modified": "2025-12-04T21:00:00Z",
      "template": "default"
    }
  ],
  "total": 2,
  "generated": "2025-12-10 13:18:25"
}

Use Cases

Discovery

Query this endpoint to discover all available content in the CMS without prior knowledge of the structure.

Navigation

Build dynamic navigation menus based on the actual content structure.

Documentation Browser

Power the GROOV API browser by listing all available endpoints and documentation pages.

Example Usage

JavaScript

const response = await fetch('https://api.infinity.b0x.store/api/pages.json');
const data = await response.json();

data.pages.forEach(page => {
  console.log(`${page.title}: ${page.route}`);
});

curl

curl https://api.infinity.b0x.store/api/pages.json | jq '.pages[].title'

Python

import requests

response = requests.get('https://api.infinity.b0x.store/api/pages.json')
pages = response.json()['pages']

for page in pages:
    print(f"{page['title']}: {page['route']}")

The Ouroboros Pattern

This endpoint demonstrates the self-referential nature of GROOV:

  • It lists the documentation about itself
  • The page describing this endpoint appears in its own results
  • Creates a complete knowledge loop - the system fully describes itself

Related Endpoints


Last updated: 2025-12-10 13:18:25