Page API
The primary role of the Page API is to provide the data required to render a hierarchical page structure for a given URL.
Endpoint: GET /api/pages/{slug}
Section titled “Endpoint: GET /api/pages/{slug}”This endpoint handles both simple slugs (/contact) and nested paths (/about-us/team).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
slug | string | The full path of the page (catch-all). |
Success Response (200 OK)
Section titled “Success Response (200 OK)”{ "id": "019cafbf-cadf-712a-8f54-de7ffda15188", "title": "Welcome World", "content": null, "seo": null, "full_url": "/welcome-world", "published_at": "2026-03-04T00:00:00.000000Z", "is_password_protected": false}Response Codes
Section titled “Response Codes”- 200 OK: Strona The page exists, is published, and ready to render.
- 403 Forbidden: The page is scheduled for the future or marked as private.
- 404 Not Found: The page doesn't exist or the provided slug mismatch the database hierarchy (e g., accessing a child page without the parent path).
Hierarchy Validation
Section titled “Hierarchy Validation”The API doesn’t just look for the last segment of the slug. It ensures the computed full_url in the database matches exactly what the user requested, preventing SEO issues like duplicate content.