MJS exposes all core functionality via RESTful APIs, designed for extensibility and integration.
- All endpoints follow REST conventions and are documented with OpenAPI/Swagger.
- API versioning is used to ensure backward compatibility (e.g.,
/api/v1/...). - All responses use JSON format.
- Errors follow a consistent structure:
{ "error": { "code": "string", "message": "string", "details": {} } }
- OAuth2/OpenID Connect (Keycloak) is used for authentication.
- Most endpoints require a Bearer token (JWT) in the
Authorizationheader. - Scopes and roles control access to protected resources.
POST /api/v1/auth/login— Authenticate userGET /api/v1/users/me— Get current user profileGET /api/v1/articles— List articlesPOST /api/v1/articles— Submit new articleGET /api/v1/reviews— List reviews- ...and more (see auto-generated Swagger docs)
- Plugins can register new endpoints by declaring them in their manifest and implementing handlers.
- API extensions must follow the same versioning and error format.
- See PLUGINS.md for extension guidelines.
curl -H "Authorization: Bearer <token>" https://your-mjs-instance/api/v1/articlescurl -X POST -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"title": "My Article", "content": "..."}' \
https://your-mjs-instance/api/v1/articles- The full OpenAPI/Swagger spec is available at
/api/docswhen the backend is running. - For more details, see the Development Guide and plugin extension docs.