Pages API

Static pages (About, Pricing, Contact, etc.) are exposed through a parallel endpoint to posts. Same response shape, different content_type.

Public Endpoints

GET /api/v1/pages

List published pages.

curl https://your-site.com/api/v1/pages

Query parameters:

Param Default Description
page 1 Page number
per_page 25 Items per page (max 100)

Response: same shape as /api/v1/posts — list of page objects in data, pagination in pagination.

Pages are returned alphabetically by title (not by date), since they're navigational rather than chronological.

GET /api/v1/pages/{slug}

Fetch a single page with full body.

curl https://your-site.com/api/v1/pages/about

Returns 404 for unpublished pages or non-existent slugs. The endpoint also returns 404 if you pass the slug of a blog post (use /api/v1/posts/{slug} for those).

Admin Endpoints

Pages share the same admin endpoint as posts — set content_type: "page" when creating.

curl -X POST https://your-site.com/api/v1/admin/posts \
  -H "Authorization: Bearer ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "About Us",
    "slug": "about",
    "body": "<p>Page content</p>",
    "content_type": "page",
    "is_published": true
  }'

Update and delete use the same admin endpoints (PATCH /api/v1/admin/posts/{id}, DELETE /api/v1/admin/posts/{id}).

Difference Between Posts and Pages

Posts (content_type: "post") Pages (content_type: "page")
Public URL /blog/{slug} /{slug}
Public API /api/v1/posts /api/v1/pages
Default order Latest first Alphabetical by title
Has categories Yes Usually no
In sitemap Under blog section Under pages section
Schedulable Yes (posted_at) Yes (rarely used)

Both are stored in the same posts table — the content_type enum drives the difference.