Base URL
All API endpoints are prefixed with/api/ and follow RESTful conventions:
Architecture
The Mantis API is built using:- Django REST Framework - Robust REST API toolkit
- Django 4.2 - Backend framework
- JSON - Response format for all endpoints
- Session-based authentication - Secure authentication using django-user-sessions
Available API Modules
The API is organized into the following modules:Projects
Manage project resources, assignments, and project lifecycle:GET /api/projects/resources/available/- List available resourcesPOST /api/projects/resources/add/- Add resource to projectPOST /api/projects/resources/update/- Update project resourceDELETE /api/projects/resources/delete/<id>/- Remove resource from projectPOST /api/projects/resources/release/- Release resource from projectGET /api/projects/<project_id>/resources/- Get project resourcesGET /api/projects/all-info/<project_id>/- Get complete project informationPOST /api/projects/<project_id>/close/- Close a project
Equipment
Manage equipment and resources:POST /api/resources/update/- Update resource information
Work Orders
Manage work order sheets, custody chains, and project items:GET /api/workorders/sheets/project/<project_id>/- List all sheets for a projectPOST /api/workorders/sheets/create/- Create new work sheetPOST /api/workorders/sheets/update/- Update work sheetDELETE /api/workorders/sheets/delete/- Delete work sheetPOST /api/workorders/sheets/detail/<detail_id>/days/- Update sheet detail daysPOST /api/workorders/sheets/reopen/- Reopen a work sheetGET /api/workorders/sheets/items/<sheet_project_id>/- Get sheet itemsPOST /api/workorders/custody_chain/create/- Create custody chainGET /api/workorders/custody_chain/detail/<id>/- Get custody chain detailsPUT /api/workorders/custody_chain/<id>/edit/- Edit custody chainPOST /api/workorders/custody_chain/regenerate-codes/- Regenerate equipment codes
Vehicles
Manage vehicle certifications and passes:POST /api/vehicles/cert_vehicle/- Create/update vehicle certificationDELETE /api/vehicles/cert_vehicle/<pk>/- Delete vehicle certificationPOST /api/vehicles/pass_vehicle/- Create/update vehicle passDELETE /api/vehicles/pass_vehicle/<pk>/- Delete vehicle passGET /api/vehicles/avaliables/- List available vehicles
Technicals
Manage technical personnel passes and vaccines:POST /api/technicals/create_update_pass_technical/- Create/update technical passPOST /api/technicals/create_update_vaccine/- Create/update vaccine recordDELETE /api/technicals/delete_pass_technical/- Delete technical passDELETE /api/technicals/delete_vaccine/- Delete vaccine recordGET /api/technicals/avaliables/- List available technicals
Documents
Centralized file management and document operations:POST /api/load_files/- Upload filesGET /api/load_files/fields/- Get model file fieldsGET /api/load_files/tree/- Get document treeGET /api/load_files/project/<project_id>/tree/- Get project document treePOST /api/load_files/project/<project_id>/merge/- Merge project documentsPOST /api/load_files/project/<project_id>/bulk_custody/- Bulk custody uploadGET /api/load_files/sheet/<sheet_id>/merge-generated/- Merge generated sheet documentsGET /api/load_files/vehicle/<vehicle_id>/merge-generated/- Merge generated vehicle documentsGET /api/load_files/technical/<technical_id>/merge-generated/- Merge generated technical documents
Shipping Guides
Manage shipping guides:GET /api/shipping/guides/- List shipping guidesPOST /api/shipping/guides/- Create shipping guideGET /api/shipping/guides/<guide_id>/- Get shipping guide detailsPUT /api/shipping/guides/<guide_id>/- Update shipping guideDELETE /api/shipping/guides/<pk>/delete/- Delete shipping guide
Maintenance
Manage maintenance sheets:GET /api/maintenance/sheets/- List maintenance sheetsPOST /api/maintenance/sheets/- Create maintenance sheetGET /api/maintenance/sheets/<sheet_id>/- Get maintenance sheet detailsPUT /api/maintenance/sheets/<sheet_id>/- Update maintenance sheetDELETE /api/maintenance/sheets/<pk>/delete/- Delete maintenance sheet
Calendar
Manage calendar events:GET /api/calendar/events/- List calendar eventsPOST /api/calendar/events/- Create calendar eventGET /api/calendar/events/<event_id>/- Get event detailsPUT /api/calendar/events/<event_id>/- Update eventPOST /api/calendar/events/<event_id>/move/- Move eventDELETE /api/calendar/events/<pk>/delete/- Delete event
Response Format
All API responses are returned in JSON format with the following structure:Success Response
Error Response
HTTP Status Codes
The API uses standard HTTP status codes:200 OK- Request succeeded201 Created- Resource created successfully400 Bad Request- Invalid request parameters401 Unauthorized- Authentication required403 Forbidden- Insufficient permissions404 Not Found- Resource not found500 Internal Server Error- Server error
Error Handling
When an error occurs, the API returns an appropriate HTTP status code along with a JSON response containing error details:CORS Configuration
The API supports Cross-Origin Resource Sharing (CORS) with the following configuration:- CORS_ORIGIN_ALLOW_ALL: Enabled for all origins
- Trusted Origins: Specific domains are whitelisted for CSRF protection
https://mantis.peisol.com.echttp://localhost:8000(development)- Additional development and staging origins
Rate Limiting
Rate limiting policies may apply to prevent abuse. Contact your system administrator for specific limits.
Next Steps
Authentication
Learn how to authenticate API requests
Projects API
Manage projects and resources