Skip to content

Fetching content

Documents

GET {API}/api/v1/{siteId}/{env}/{route}
js
const res = await fetch(`${API}/api/v1/${SITE}/${ENV}/about`)
if (res.ok) {
  const doc = await res.json()
}

Leading slashes are optional: /about and about reach the same document. The root document is the empty path:

GET {API}/api/v1/{siteId}/{env}/

Responses are cached at the edge for 60 seconds.

When there is no document

404 means either no such route, or a route whose document exists but is not visible to the public. The two are deliberately indistinguishable without a preview credential, so an unreleased page cannot be discovered by probing.

Handle it as your site's 404:

js
if (res.status === 404) return renderNotFound()

Partials

A partial is a document included by other documents — a navigation bar, a footer. It has no route of its own and is fetched by key:

GET {API}/api/v1/{siteId}/{env}/_partials/nav

Fetch partials once per page load, not once per component, and cache them for the life of the page.

Which routes exist

GET {API}/api/v1/{siteId}/{env}/_routes
json
{
  "routes": [
    { "route": "/about", "type": "page", "updatedAt": "2026-09-01T18:01:27Z" }
  ],
  "partials": ["nav", "footer"]
}

Use this in a static build to discover what to generate:

js
const { routes } = await fetch(`${API}/api/v1/${SITE}/${ENV}/_routes`).then((r) => r.json())
const paths = routes.map((r) => r.route)

Redirects

GET {API}/api/v1/{siteId}/{env}/_redirects
json
{ "redirects": [{ "from": "/old", "to": "/new", "status": 301 }] }

See Redirects for turning these into your host's redirect rules.

Translated strings

GET {API}/api/v1/{siteId}/{env}/i18n/en

A flat object, ready to hand to vue-i18n or anything with the same shape:

json
{ "common.buttons.save": "Save", "forms.email.invalid": "Enter a valid email." }

Media

Media URLs come back absolute in document fields, so you can use them directly:

html
<img :src="fields.image.url" :alt="fields.image.alt" />

They are cached immutably, so never rewrite or proxy them for cache-busting.

Environments

{env} is production for your live site. Point a preview build at another environment by changing that segment only:

bash
VITE_CMS_ENV=staging pnpm dev

Failure

Treat the CMS as you would any upstream: a build that fetches content should fail loudly rather than emit a site with pages missing.

js
const res = await fetch(url)
if (!res.ok && res.status !== 404) {
  throw new Error(`CMS ${res.status} for ${route}`)
}

A 404 is content ("this page does not exist"). Anything else is an outage, and generating a site from it silently deletes pages.

A Nubisco product. Not open source.