MapleCMS exposes a clean, RESTful API built with FastAPI, designed to be fast, secure, and easy to integrate with any frontend or external service.
This document outlines all key endpoints, authentication methods, and data schemas.
- Base URL (Local):
http://localhost:8000/api/v1 - Base URL (Production):
https://api.maplecms.com/api/v1 - Format: JSON (
application/json) - Authentication: JWT Bearer Token
POST /auth/login
{
"email": "user@example.com",
"password": "password123"
}Response:
{
"access_token": "<JWT_TOKEN>",
"token_type": "bearer",
"expires_in": 3600
}POST /auth/register
{
"username": "john_doe",
"email": "john@example.com",
"password": "strongpassword"
}Response:
{
"message": "User registered successfully",
"user_id": 12
}POST /auth/refresh
{
"refresh_token": "<REFRESH_TOKEN>"
}Response:
{
"access_token": "<NEW_JWT_TOKEN>"
}GET /articles/
Response:
[
{
"id": 1,
"title": "Welcome to MapleCMS",
"slug": "welcome-maplecms",
"author": "Admin",
"tags": ["intro", "cms"],
"created_at": "2025-01-05T10:30:00Z"
}
]GET /articles/{id}
Response:
{
"id": 1,
"title": "Welcome to MapleCMS",
"content": "<html>Article body here...</html>",
"author": "Admin",
"category": "Tutorial",
"published": true
}POST /articles/
Auth Required ✅
{
"title": "My New Article",
"content": "MapleCMS makes content creation simple!",
"tags": ["fastapi", "nextjs"],
"category": "Development",
"published": true
}Response:
{
"id": 22,
"message": "Article created successfully"
}PUT /articles/{id}
{
"title": "Updated Title",
"content": "Updated content..."
}Response:
{
"message": "Article updated"
}DELETE /articles/{id}
Response:
{
"message": "Article deleted successfully"
}POST /media/upload
- Type:
multipart/form-data
curl -X POST -F "file=@/path/to/image.png" https://api.maplecms.com/api/v1/media/uploadResponse:
{
"file_url": "https://cdn.maplecms.com/uploads/image.png"
}GET /media/
Response:
[
{"filename": "image.png", "url": "https://cdn.maplecms.com/uploads/image.png"}
]GET /users/me
Auth Required ✅
Response:
{
"id": 5,
"username": "john_doe",
"email": "john@example.com",
"role": "editor"
}GET /users/
Response:
[
{"id": 1, "username": "admin"},
{"id": 2, "username": "editor"}
]GET /categories/
[
{"id": 1, "name": "Tutorials"},
{"id": 2, "name": "Guides"}
]POST /categories/
{
"name": "AI"
}Response:
{
"message": "Category created"
}GET /health
{
"status": "ok",
"uptime": "3 days, 12 hours"
}GET /version
{
"version": "1.0.0",
"build": "2025-01-07T10:00:00Z"
}- All endpoints are CORS-enabled for integration with the Next.js frontend.
- Rate limiting and caching can be enabled in production.
- Future versions will include GraphQL and WebSocket endpoints.
MapleCMS API — built to be lightweight, scalable, and developer-friendly.