Cloudcore

API Reference

All endpoints are prefixed with /api/v1.

Public API (no authentication)

Use these from your frontend to fetch published content.

MethodEndpointDescription
GET/public/contentList published content. Query: ?type=page&limit=20&offset=0
GET/public/content/:type/:slugGet single published content by type and slug
GET/public/categoriesList all categories
GET/public/tagsList all tags
GET/media/:id/fileServe a media file (images, videos, PDFs)

Auth API

MethodEndpointAuthDescription
GET/auth/statusNoCheck setup status and available auth methods
POST/auth/setupNoCreate first admin account
POST/auth/loginNoLogin with email/password
POST/auth/logoutNoLogout (clears session)
GET/auth/meYesGet current user
PATCH/auth/meYesUpdate own profile
POST/auth/me/change-passwordYesChange own password

Content API (requires auth)

MethodEndpointRoleDescription
GET/contentAnyList all content (including drafts)
GET/content/:idAnyGet content by ID
POST/contentAnyCreate content
PATCH/content/:idOwner/Editor+Update content
DELETE/content/:idOwner/Editor+Delete content
POST/content/:id/publishEditor+Publish content
POST/content/:id/unpublishEditor+Unpublish content
GET/content/:id/revisionsOwner/Editor+List revision history

Media API (requires auth)

MethodEndpointRoleDescription
GET/mediaAnyList media files
POST/media/uploadAnyUpload a file (multipart form)
PATCH/media/:idEditor+Update media metadata
DELETE/media/:idEditor+Delete media file

Taxonomy API (requires auth)

MethodEndpointRoleDescription
POST/categoriesEditor+Create category
PATCH/categories/:idEditor+Update category
DELETE/categories/:idEditor+Delete category
POST/tagsEditor+Create tag
PATCH/tags/:idEditor+Update tag
DELETE/tags/:idEditor+Delete tag

Settings API (admin only)

MethodEndpointDescription
GET/settingsGet all settings
PUT/settings/:keyUpdate a setting
DELETE/settings/:keyDelete a setting

Authentication

The API supports two auth methods:

  • Session cookie — set by /auth/login. Include credentials: 'include' in fetch requests.
  • Bearer token — pass Authorization: Bearer YOUR_ADMIN_TOKEN header. Uses the ADMIN_TOKEN env var.

All state-changing requests require the X-CloudCore-Request: 1 CSRF header.