Pages & content API

Create, read, update and delete content articles in bulk or one at a time.

Endpoints

MethodPathDescription
GET/api/content/statsContent statistics: totals, categories, last update
GET/api/content/categoriesPublished content grouped by category
GET/api/content/item/:idRetrieve one article by ID or slug
POST/api/contentBulk insert articles
PUT/api/content/item/:idUpdate one article
PUT/api/content/bulkBulk update articles
DELETE/api/content/item/:idDelete one article
DELETE/api/content/bulkBulk delete articles by ID or slug

Insert articles

POST /api/content accepts an articles array and upserts each row (batches of 100). If slug is omitted it is generated from the title; tags default to the primary keyword.

curl -X POST "https://your-domain.com/api/content" \
  -H "X-API-Key: $CONTENT_HUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "articles": [
      {
        "id": "article-123",
        "title": "Understanding Car Insurance",
        "body": "<p>Content body...</p>",
        "slug": "understanding-car-insurance",
        "type": "article",
        "status": "published",
        "category": "insurance",
        "primary_keyword": "car insurance",
        "search_volume": 25000,
        "word_count": 1250,
        "tags": ["car insurance", "auto insurance"]
      }
    ]
  }'

Response

{
  "success": true,
  "message": "Inserted 1 articles",
  "stats": {
    "total_inserted": 1
  }
}

Article fields

FieldTypeNotes
idstringRequired. Unique identifier.
titlestringRequired. Shown in lists and the browser tab.
bodystringRequired. HTML content of the article.
slugstringOptional, unique. Forms the public URL; generated from the title if omitted.
typestringDefaults to `article`.
statusenumdraft · published. Public retrieval filters on published.
categorystringUsed to group content on the site.
primary_keywordstringMain SEO keyword for the article.
search_volumenumberMonthly search volume for the primary keyword.
word_countnumberArticle length.
tagsstring[] | stringJSON array or comma-separated string.
published_atstringISO 8601 timestamp.

Retrieve an article

GET /api/content/item/:id accepts an ID or a slug and returns the article with its parsed metadata.

curl "https://your-domain.com/api/content/item/understanding-car-insurance" \
  -H "X-API-Key: $CONTENT_HUB_API_KEY"

Mutations invalidate the content cache immediately, so published changes are live on the site without a redeploy. See the full reference in docs/api/content.md and the copy-paste snippets under Code examples.