API ยท Pages

API overview

POST/api/pages/preview

Requires Bearer token + pages permission.

Render Markdown to HTML (shortcodes processed, no frontmatter). Useful for live editor previews.

Field Type Description
markdown string Markdown string to render
// Response 200
{ "html": "<p>Hello <strong>world</strong></p>" }

GET/api/pages/tags

Requires Bearer token + pages permission.

Aggregate all unique tags across every page, sorted alphabetically.

// Response 200
{ "tags": ["guide", "news", "tutorial"] }

GET/api/pages

Requires Bearer token + pages permission.

List all pages with their metadata. Body content is excluded.

// Response 200
[
  {
    "urlPath": "/about",
    "title": "About Us",
    "slug": "about",
    "status": "published",
    "layout": "default",
    "tags": [],
    "updatedAt": "2024-01-15T10:30:00.000Z",
    "createdAt": "2024-01-01T09:00:00.000Z"
  }
]

GET/api/pages/*

Requires Bearer token + pages permission. The * is the URL path, e.g. /api/pages/about.

Retrieve a single page including its frontmatter and full body content.

// Response 200
{ "urlPath": "/about", "title": "About Us", "body": "## Our Story\n\nWe started...", ... }

// Error 404
{ "error": "Page not found" }

POST/api/pages

Requires Bearer token + pages permission.

Create a new page. Fails with 409 if a page already exists at the given path.

Field Type Description
urlPath string Required. Public URL path e.g. /about
frontmatter object YAML frontmatter fields (title, status, etc.)
body string Markdown content
// Response 201 - returns the created page object

PUT/api/pages/*

Requires Bearer token + pages permission.

Update an existing page. Optionally rename it to a new URL path.

Field Type Description
frontmatter object Updated frontmatter fields
body string Updated Markdown content
newUrlPath string Optional. Rename the page to a different URL path
// Response 200 - returns the updated page object

// Error 404
{ "error": "Page not found" }

// Error 409
{ "error": "A page already exists at that path" }

DELETE/api/pages/*

Requires Bearer token + pages permission.

Delete a page and its source file.

// Response 200
{ "success": true }

// Error 404
{ "error": "Page not found" }