Skip to content

REST API

The CMS auto-generates REST API endpoints for every collection, plus built-in endpoints for auth, media, users, roles, settings, and system health.

Collection Endpoints

MethodPathDescriptionAuth
GET/api/{collection}List entriesYes
GET/api/{collection}/:idGet single entryYes
POST/api/{collection}Create entryYes
PATCH/api/{collection}/:idUpdate entryYes
DELETE/api/{collection}/:idDelete entryYes
POST/api/{collection}/bulk-deleteBulk delete entriesYes
POST/api/{collection}/:id/publishPublish draftYes
POST/api/{collection}/:id/unpublishUnpublish entryYes
POST/api/{collection}/:id/restoreRestore soft-deleted entryYes
GET/api/{collection}/:id/versionsList versionsYes
POST/api/{collection}/:id/versions/:versionId/restoreRestore versionYes

Global Endpoints

MethodPathDescriptionAuth
GET/api/globals/:slugGet global dataYes
PUT/api/globals/:slugUpsert global dataYes

Auth Endpoints

MethodPathDescriptionAuth
POST/api/auth/loginLogin with email/passwordNo
POST/api/auth/registerRegister new userNo*
POST/api/auth/refreshRefresh access tokenNo
POST/api/auth/forgot-passwordRequest password resetNo
POST/api/auth/reset-passwordReset password with tokenNo
GET/api/auth/setup-statusCheck if admin existsNo

*Register requires admin permissions unless it's the first user (setup guard).

Media Endpoints

MethodPathDescriptionAuth
GET/api/mediaList media filesYes
GET/api/media/:idGet media fileYes
POST/api/mediaUpload media fileYes
DELETE/api/media/:idDelete media fileYes
GET/api/media/file/:idServe media fileYes
POST/api/media/foldersCreate folderYes
DELETE/api/media/folders/:idDelete folderYes

User Endpoints

MethodPathDescriptionAuth
GET/api/usersList usersYes
GET/api/users/:idGet userYes
POST/api/usersCreate userYes
PATCH/api/users/:idUpdate userYes
DELETE/api/users/:idDelete userYes

Role Endpoints

MethodPathDescriptionAuth
GET/api/rolesList rolesYes
GET/api/roles/:idGet roleYes
POST/api/rolesCreate roleYes
PATCH/api/roles/:idUpdate roleYes
DELETE/api/roles/:idDelete roleYes

Settings Endpoints

MethodPathDescriptionAuth
GET/api/settings/api-tokensList API tokensYes
POST/api/settings/api-tokensCreate API tokenYes
DELETE/api/settings/api-tokens/:idRevoke API tokenYes
GET/api/settings/webhooksList webhooksYes
GET/api/settings/webhooks/:idGet webhookYes
POST/api/settings/webhooksCreate webhookYes
PUT/api/settings/webhooks/:idUpdate webhookYes
DELETE/api/settings/webhooks/:idDelete webhookYes

System Endpoints

MethodPathDescriptionAuth
GET/healthHealth checkNo
GET/api/activityActivity logYes
GET/api/pluginsList pluginsYes

Query Parameters (Collection Endpoints)

ParameterTypeDescription
limitnumberPage size (default: 10, max: 100)
offsetnumberPagination offset
sortstringSort by field (e.g., title:desc)
selectstringField selection (e.g., title,body)
populatestringRelation population (e.g., author)
where[field]anyFilter by field value
localestringLocale for localized content
deletedbooleanInclude soft-deleted entries

Authentication

JWT Token

bash
curl -H "Authorization: Bearer <jwt-token>" http://localhost:3000/api/posts

API Token

bash
curl -H "Authorization: Bearer cms_<token>" http://localhost:3000/api/posts

API tokens are created in the admin UI at Settings → API Tokens. They are long-lived, explicitly revocable, and intended for programmatic API access.

Example Requests

bash
# List posts
curl http://localhost:3000/api/posts?limit=10&offset=0

# Get single post with author populated
curl http://localhost:3000/api/posts/1?populate=author

# Create post
curl -X POST http://localhost:3000/api/posts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"title": "Hello World", "status": "published"}'

# Filter posts
curl "http://localhost:3000/api/posts?where[status]=published&sort=createdAt:desc"

# Get global settings
curl http://localhost:3000/api/globals/site-settings

# Upload media
curl -X POST http://localhost:3000/api/media \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"file": {"data": "<base64>", "mimeType": "image/png", "name": "logo.png"}}'

OpenAPI / Swagger

The REST API is self-documenting via OpenAPI 3.1. Visit /docs on your API server to access the Swagger UI with interactive endpoint testing.

Error Responses

StatusCodeDescription
400VALIDATION_ERRORInvalid request body or query params
401UNAUTHORIZEDMissing or invalid JWT/API token
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource not found
409CONFLICTUnique constraint violation
413PAYLOAD_TOO_LARGERequest body exceeds limit
500INTERNAL_ERRORServer error

Released under the MIT License.