WebSocket API (STOMP)
MastermindCMS exposes a STOMP broker over WebSocket:- Native WebSocket endpoint:
/ws - SockJS fallback endpoint:
/sock - Application destination prefix:
/request - Broker destinations:
/topic/**,/user/topic/**, and/queue/**
Subscribe
Default JSON responses:/topic/msm/json/user/topic/msm/json
/topic/msm/render/user/topic/msm/render
/topic/** (for example /topic/jobs, /topic/job/{id}, /topic/order/{id}, /topic/customer/{id}).
Publish destinations
Render (SSR):
JSON:
Request and response shape
All WebSocket requests are based onBasicRequestMessage:
path: current page path (request context)payload: optional data (depends on the destination)elements: optional list of element payloads for partial updatesactionId: optional correlation id (recommended)eventType:USER,SHARED, orGLOBALsharedEndpoint: optional logical endpoint name (the backend responds to/topic/<sharedEndpoint>)
BeanRequestMessage:scope,beanId,functionName,argsRepositoryRequestMessage:repositoryId,requestTypeDocumentRequestMessage:databaseName,collectionName,requestType
Example (browser)
Authorization notes
- JSON handlers can accept a JWT via the native header
Authorization: Bearer <token>. - Some operations require elevated permissions (for example repository updates and database writes). If access is denied, the backend responds with
{ "error": "Access denied", ... }.
REST API
REST is used for:- authentication (
/api/v1/authenticate,/api/v1/logout, token operations) - file and data operations (upload/remove/download)
- report export and asset listing
- integrations (for example, delivery/payment providers)
- HTTP fallback for service calls (
/api/v1/bean/request)
Common headers
Some endpoints (notably/api/v1/bean/request) require request context headers:
Authentication
POST /api/v1/authenticate authenticates a user (typically via session/remember-me cookies).
To obtain a JWT token for API calls, use POST /api/v1/auth/token (returns { token, expires }). You can validate a token with POST /api/v1/auth/validate-token.
POST /api/v1/logout logs out the current session and expects a JSON body that includes role (for example "user" or "admin").
Unified service call over HTTP
POST /api/v1/bean/request calls a backend bean method using the same reflection-based mechanism as the WebSocket API.
Required headers:
Site-ContextLang-Context
Uploads, downloads, assets, reports
Example: upload an image
Delivery and payment integrations
Some integrations are exposed as REST endpoints and used by corresponding UI components. Examples include:/api/v1/cdek(delivery widget service/proxy)/api/v1/stripe(Stripe payment webhook)/api/v1/yookassa(payment integration)
Password reset and verification
If email/password flows are enabled, MastermindCMS can expose endpoints such as:/api/v1/auth/verify/api/v1/auth/reset-password/api/v1/auth/change-password/api/v1/auth/save-password