Skip to content

Rokfor CMS API Documentation ​

REST API for the Rokfor CMS backend. Built with Koa.js + TypeScript, persisting data via MikroORM (MariaDB/MySQL).

Quick Start ​

  1. Obtain a JWT token (see Authentication)
  2. Make API requests with Authorization: Bearer <token>
  3. Use the Query Syntax for filtering and pagination

API Endpoints ​

Content ​

  • Collection — Query, create, update, and delete content entries in bulk
  • Item — Single content entry operations
  • File Uploads — Uploading binaries to Bild fields via multipart/form-data

Structure ​

  • Books — Top-level publications
  • Chapters — Chapters (sections within books)
  • Issues — Issues (editions/volumes within books)

Configuration ​

  • Templates — Template groups (content types)
  • Fields — Template field definitions
  • Exporters — Export plugins and PDF generation

Administration ​

  • Users — User management
  • Rights — Access rights groups

Reference ​

Base URL ​

http://localhost:{SERVER_PORT}/api

Domain Model ​

Books (publication)
  ├── Issues (editions/volumes)
  │     └── Contributions (content entries)
  │           └── Data (individual field values)
  └── Chapters (sections)
        └── Contributions (content entries)

Templatenames (template group / content type)
  └── Templates (field definitions)

Rights → links Users to Books / Issues / Chapters / Templates

Caching / Conditional Requests ​

All responses include an ETag header. Clients can use conditional requests to avoid re-downloading unchanged data:

  1. Store the ETag value from a response
  2. On subsequent requests, send it as If-None-Match:
GET /api/collection/articles
If-None-Match: "abc123"

If the content hasn't changed, the server responds with 304 Not Modified and an empty body, saving bandwidth and processing time.

Response Format ​

All endpoints return JSON. List endpoints return:

json
{
  "items": [...],
  "_count": 42,
  "_limit": 1000,
  "_offset": 0
}

Single-entity endpoints return the entity object directly.

Error responses:

json
{
  "error": "Error message"
}