CMS One
Sign in
API Reference

v1 REST API

Fetch content from CMS One using simple HTTP endpoints. Authenticate with an API key and start serving articles to any front‑end, app, or service.

GET /api/v1/articlesGET /api/v1/articles/:slug

Overview

The v1 API exposes published content from your workspace over HTTPS. All requests must be authenticated and all responses use the same JSON envelope.

REST + JSON

Simple HTTP endpoints returning predictable JSON responses. No SDK required.

API Key Auth

Authenticate every request with a Bearer token scoped to your workspace.

Paginated Lists

All collection endpoints support page, limit, search, and sort parameters.

Consistent Errors

Every error returns { success: false, error } with a reliable HTTP status code.

Base URL

https://your-domain.com/api/v1

Replace your-domain.com with your own domain or the CMS One cloud hostname.

Authentication

Every request must include a valid API key in the Authorization header. Generate keys from Dashboard → Settings → API Keys. Keys are scoped to your workspace — they only grant access to content belonging to that tenant.

Required header

Authorization: Bearer YOUR_API_KEY
const res = await fetch("https://your-domain.com/api/v1/articles", {
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
  },
});

const { success, data, meta } = await res.json();

Where to find your API key

Open your dashboard and navigate to Settings → API Keys. Create a new key, copy it once — it will not be shown again.

Articles

The Articles resource gives read‑only access to all published content in your workspace. Two endpoints are available: one for listing and one for fetching a single article by its slug.

GET/api/v1/articlesList Articles

Returns a paginated list of published articles for your workspace. Results are ordered by publish date (newest first) by default. Filter by type, category, tag, or language, and search full‑text across titles and content.

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (1‑based).
limitnumber10Results per page. Maximum 100.
typestringFilter by article type. One of: blog, news, case-study, tutorial, documentation, page.
categorystringFilter by category slug (e.g. guides).
tagstringFilter by tag slug or name.
searchstringFull‑text search term matched against titles and content.
languagestringISO language code (e.g. "en", "fr").
sortstringlatest"latest" orders by publishedAt desc (default); "popular" orders by view count desc.

Example

const res = await fetch(
  "https://your-domain.com/api/v1/articles?page=1&limit=5&sort=latest",
  {
    headers: { Authorization: "Bearer YOUR_API_KEY" },
  }
);

const { success, data, meta } = await res.json();
// data → Article[]
// meta → { page: 1, limit: 5, total: 48, totalPages: 10 }

Response Fields

FieldTypeDescription
idstringArticle ObjectId as a hex string.
titlestringArticle title.
slugstringURL‑friendly identifier. Use this to fetch the full article.
excerptnullablestringShort summary suitable for list views.
typestringContent type (blog, tutorial, etc.).
featuredImagenullablestringCover image URL.
featuredImageAltnullablestringImage alt text.
categories{ id, name, slug }[]Resolved category objects.
tagsstring[]Tag slugs / names.
languagestringLanguage code.
publishedAtISO stringPublication date.
readCountnumberTotal view count.
likeCountnumberTotal likes.
commentCountnumberTotal comments.
isFeaturedbooleanWhether the article is featured.
isPinnedbooleanWhether the article is pinned.
GET/api/v1/articles/:slugGet Article

Returns the full content of a single published article identified by its slug. Includes the raw body (HTML or Markdown), resolved category and tag objects, SEO metadata, and up to 5 related articles. Calling this endpoint also increments the article's view counter — repeat visits within the same time window are deduplicated automatically.

Example

const slug = "getting-started-with-cms-one";

const res = await fetch(
  `https://your-domain.com/api/v1/articles/${slug}`,
  {
    headers: { Authorization: "Bearer YOUR_API_KEY" },
  }
);

const { success, data } = await res.json();
// data.content     → full article body
// data.contentType → "html" | "markdown"
// data.related     → up to 5 related articles

Response Fields

FieldTypeDescription
idstringArticle ObjectId as a hex string.
titlestringArticle title.
slugstringURL‑friendly identifier.
contentstringFull article body. Check contentType to determine the format.
contentType"html" | "markdown"Format of the content field.
excerptnullablestringShort summary.
typestringContent type.
featuredImagenullablestringCover image URL.
gallerystring[]Additional image URLs.
languagestringLanguage code.
publishedAtISO stringPublication date.
updatedAtISO stringLast updated date.
categories{ id, name, slug, description? }[]Fully resolved category objects.
tags{ name, slug, color }[]Fully resolved tag objects including brand color.
readCountnumberTotal view count (incremented by this request, deduplicated).
likeCountnumberTotal likes.
commentCountnumberTotal comments.
allowCommentsbooleanWhether the comment section is open.
isFeaturedbooleanFeatured flag.
seoobjectSEO metadata: { title, description, ogImage, noIndex }.
relatedRelatedArticle[]Up to 5 related articles based on shared categories and tags.

Error Handling

Every failed request returns a JSON body with success: false and a human‑readable error string. Always check the HTTP status code first, then inspect the body for details.

StatusWhen it occursResponse body
401The Authorization header is missing, malformed, or the API key does not exist.{ "success": false, "error": "Unauthorized" }
403The API key is valid but disabled, or it does not belong to the target workspace.{ "success": false, "error": "API key is disabled" }
404The requested article does not exist, is not published, or its publish date is in the future.{ "success": false, "error": "Article not found" }
500An unexpected server error occurred. Please verify your request and try again.{ "success": false, "error": "Failed to fetch articles" }