Content (CMS) API Reference

Public read-only delivery endpoints for pages, blogs, collections, navigation, and settings — plus authenticated management endpoints for drafts, publishing, rollbacks, and media uploads.

Content Delivery Endpoints

Scoped by website slug (:key). Require Authorization: Bearer sf_tok_... (or JWT). Only published content is returned unless a valid signed previewToken is supplied.

GET/api/v1/public/websites/:key/pages

List Published Pages & Blogs

Returns all published pages and blog posts for a website, optionally filtered by locale.

Bearer JWT / sf_tok_
ParameterInTypeDescription
key*pathstringWebsite slug key.
localequerystringOptional locale code (e.g. en).
Request
bash
curl -X GET "https://api.sitefabric.space/api/v1/public/websites/acme/pages?locale=en" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
[
  {
    "id": "674f1c2e9a1b2c3d4e5f6a88",
    "slug": "home",
    "title": "Welcome to Acme",
    "pageType": "page",
    "locale": "en",
    "status": "published",
    "publishedAt": "2026-12-03T18:00:00.000Z"
  }
]
GET/api/v1/public/websites/:key/pages/:slug

Get Published Page by Slug (with Draft Preview Support)

Fetches a single published page including its ordered CMS blocks. Pass a signed previewToken to inspect unpublished drafts safely.

Bearer JWT / sf_tok_
ParameterInTypeDescription
key*pathstringWebsite slug key.
slug*pathstringPage slug (e.g. home, about).
localequerystringOptional locale code.
previewTokenquerystringOptional signed draft preview token.
Request
bash
curl -X GET "https://api.sitefabric.space/api/v1/public/websites/acme/pages/home?locale=en" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "id": "674f1c2e9a1b2c3d4e5f6a88",
  "slug": "home",
  "title": "Welcome to Acme",
  "locale": "en",
  "status": "published",
  "blocks": [
    {
      "id": "blk-hero",
      "type": "hero",
      "data": {
        "heading": "Built for modern teams",
        "subheading": "Manage content and SEO from one control plane.",
        "ctaLabel": "Get Started",
        "ctaHref": "/contact"
      }
    }
  ]
}
GET/api/v1/public/websites/:key/collections/:collectionKey

Get Published Collection & Entries

Returns a structured content collection (e.g. services, team, testimonials, FAQs) and all its published entries.

Bearer JWT / sf_tok_
ParameterInTypeDescription
key*pathstringWebsite slug key.
collectionKey*pathstringCollection key (e.g. services).
localequerystringOptional locale filter.
Request
bash
curl -X GET "https://api.sitefabric.space/api/v1/public/websites/acme/collections/services?locale=en" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "collection": { "key": "services", "name": "Services" },
  "entries": [
    {
      "slug": "web-engineering",
      "status": "published",
      "data": { "title": "Web Engineering", "priceFrom": "$2,500" }
    }
  ]
}
GET/api/v1/public/websites/:key/navigation

Get Website Navigation Menu

Returns header, footer, or custom navigation menus managed in SiteFabric CRM.

Bearer JWT / sf_tok_
ParameterInTypeDescription
key*pathstringWebsite slug key.
navKeyquerystringMenu key (e.g. main, footer).
localequerystringOptional locale code.
Request
bash
curl -X GET "https://api.sitefabric.space/api/v1/public/websites/acme/navigation?navKey=main&locale=en" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "key": "main",
  "locale": "en",
  "items": [
    { "label": "Home", "href": "/" },
    { "label": "Services", "href": "/services" },
    { "label": "Contact", "href": "/contact" }
  ]
}
GET/api/v1/public/websites/:key/settings

Get Public Website Settings

Returns public brand settings, canonical domain, locales, and global content snippets.

Bearer JWT / sf_tok_
ParameterInTypeDescription
key*pathstringWebsite slug key.
Request
bash
curl -X GET "https://api.sitefabric.space/api/v1/public/websites/acme/settings" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "websiteKey": "acme",
  "name": "Acme Website",
  "canonicalDomain": "acme.com",
  "defaultLocale": "en",
  "status": "active"
}

Management Endpoints

Require Authorization: Bearer sf_tok_... (or JWT) with the corresponding cms:* permission.

POST/api/v1/cms/pages

Create Page or Blog Draft

Creates a new draft page or blog post with typed content blocks.

Bearer JWT / sf_tok_cms:draft
Request
bash
curl -X POST "https://api.sitefabric.space/api/v1/cms/pages" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token" \
  -H "Content-Type: application/json" \
  -d '{"websiteId":"674f1c2e9a1b2c3d4e5f6a7b","slug":"about","title":"About Us","pageType":"page","locale":"en","blocks":[{"id":"b1","type":"richtext","data":{"markdown":"## Our Mission"}}]}'
Response200 OK
json
{
  "id": "674f1c2e9a1b2c3d4e5f6a88",
  "slug": "about",
  "title": "About Us",
  "status": "draft",
  "revision": 1
}
POST/api/v1/cms/pages/:id/publish

Publish Page (Triggers Instant Revalidation)

Transitions a draft/review page to published, creates an immutable ContentVersion snapshot, and triggers HMAC-signed on-demand cache revalidation on the connected Next.js website.

Bearer JWT / sf_tok_cms:publish
ParameterInTypeDescription
id*pathObjectIdPage ID.
Request
bash
curl -X POST "https://api.sitefabric.space/api/v1/cms/pages/674f1c2e9a1b2c3d4e5f6a7b/publish" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "id": "674f1c2e9a1b2c3d4e5f6a88",
  "status": "published",
  "publishedAt": "2026-12-03T20:20:00.000Z",
  "revision": 2
}
POST/api/v1/cms/pages/:id/preview

Generate Draft Preview Token

Issues a short-lived signed token for previewing unpublished drafts on the live website.

Bearer JWT / sf_tok_cms:preview
ParameterInTypeDescription
id*pathObjectIdPage ID.
Request
bash
curl -X POST "https://api.sitefabric.space/api/v1/cms/pages/674f1c2e9a1b2c3d4e5f6a7b/preview" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "previewToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresInSeconds": 900
}
POST/api/v1/cms/collections

Create Content Collection

Defines a reusable structured collection (e.g. services, case-studies, faqs).

Bearer JWT / sf_tok_cms:draft
Request
bash
curl -X POST "https://api.sitefabric.space/api/v1/cms/collections" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token" \
  -H "Content-Type: application/json" \
  -d '{"websiteId":"674f1c2e9a1b2c3d4e5f6a7b","key":"services","name":"Services","description":"Core service offerings"}'
Response200 OK
json
{
  "id": "674f1c2e9a1b2c3d4e5f6d01",
  "key": "services",
  "name": "Services"
}
POST/api/v1/cms/collections/:id/entries

Create Collection Entry

Adds a structured entry inside a collection.

Bearer JWT / sf_tok_cms:draft
ParameterInTypeDescription
id*pathObjectIdCollection ID.
Request
bash
curl -X POST "https://api.sitefabric.space/api/v1/cms/collections/674f1c2e9a1b2c3d4e5f6a7b/entries" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token" \
  -H "Content-Type: application/json" \
  -d '{"slug":"seo-consulting","locale":"en","status":"published","data":{"title":"Technical SEO Consulting","summary":"Full-stack Core Web Vitals and Schema optimization."}}'
Response200 OK
json
{
  "id": "674f1c2e9a1b2c3d4e5f6a99",
  "slug": "seo-consulting",
  "status": "published"
}
PUT/api/v1/cms/navigation

Upsert Navigation Menu

Creates or replaces a named navigation menu (main, footer, etc.) for a website.

Bearer JWT / sf_tok_cms:draft
Request
bash
curl -X PUT "https://api.sitefabric.space/api/v1/cms/navigation" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token" \
  -H "Content-Type: application/json" \
  -d '{"websiteId":"674f1c2e9a1b2c3d4e5f6a7b","key":"main","locale":"en","items":[{"label":"Home","href":"/"},{"label":"Blog","href":"/blog"}]}'
Response200 OK
json
{
  "key": "main",
  "locale": "en",
  "items": [{ "label": "Home", "href": "/" }, { "label": "Blog", "href": "/blog" }]
}
POST/api/v1/cms/media/upload

Upload Media Asset (Cloudflare R2 / S3)

Uploads an image, video, or document (up to 25 MB) via multipart/form-data (fields: file, websiteId, alt?, tags?, folder?) and returns the public CDN URL.

Bearer JWT / sf_tok_cms:draft
ParameterInTypeDescription
file*bodyFile (multipart)Binary file payload (max 25 MB).
websiteId*bodyObjectIdOwning website ID.
altbodystringAccessible alt text.
folderbodystringOptional logical folder.
Request
bash
curl -X POST "https://api.sitefabric.space/api/v1/cms/media/upload" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sf_tok_your_auth_token"
Response200 OK
json
{
  "id": "674f1c2e9a1b2c3d4e5f6e01",
  "filename": "hero-banner.webp",
  "mimeType": "image/webp",
  "size": 142810,
  "url": "https://media.sitefabric.space/acme/hero-banner.webp"
}