This directory contains the OpenAPI specification and Swagger UI for the MONARC API.
swagger.yaml- OpenAPI 3.0.0 specification describing all MONARC API endpointsswagger-ui.html- Web interface for viewing and interacting with the API documentation
If you have MONARC running locally, navigate to:
http://your-monarc-installation/swagger-ui.html
- Download the
swagger.yamlfile - Visit Swagger Editor
- Import the
swagger.yamlfile
Import the swagger.yaml file into API testing tools:
- Postman
- Insomnia
- HTTPie
- Or any OpenAPI-compatible tool
Most API endpoints require authentication. To authenticate:
-
Login: Send a POST request to
/api/authwith your credentials:{ "email": "your-email@example.com", "password": "your-password" } -
Use Token: Include the returned token in subsequent requests using the
Tokenheader:Token: your-authentication-token
The API is organized into the following categories:
- Authentication - User login and logout
- Users - User management (admin only)
- Roles - User role management
- ANR - Risk analysis management
- Assets - Asset management within analyses
- Threats - Threat management
- Vulnerabilities - Vulnerability management
- Measures - Control/measure management
- Risks - Risk assessment and management
- Recommendations - Recommendation management
- Treatment Plan - Risk treatment planning
- SOA - Statement of Applicability
- Records (GDPR) - Processing activities records
- Instances - Asset instances in risk analyses
- Snapshots - Analysis snapshots
- Statistics - Statistical data
- And many more...
All API endpoints are relative to your MONARC installation's base URL.
For example:
- Local:
http://localhost/api/... - Production:
https://your-domain.com/api/...
The current API version is documented in the swagger.yaml file (version 2.13.3 as of this update).
When adding new API endpoints:
- Update the route configuration in
config/module.config.php - Add the endpoint documentation to
public/swagger.yaml - Ensure proper authentication and authorization are documented
- Include request/response examples where applicable
For more information about MONARC:
- Website: https://www.monarc.lu
- Documentation: https://www.monarc.lu/documentation
- GitHub: https://github.com/monarc-project