Machines API
The Machines API manages machine status, monitoring, and historical tracking for production equipment.Authentication
- Read operations:
VIEW_MACHINESpermission - Status updates:
MANAGE_MACHINESpermission
Get All Machines
VIEW_MACHINES
Returns all registered machines with their current operational status.
Response
Array of machine objects.Machine ID
Machine code (e.g., “TEL-01”, “CONV-02”)
Machine name
Assigned process ID (1-9)
Current operational status: Operativa, Mantenimiento, Fuera de servicio
Theoretical production capacity per hour
Capacity unit (kg/h, m/h, unidades/h, etc.)
ISO timestamp of last status change
Example Request
cURL
Example Response
Get Machine by ID
VIEW_MACHINES
Returns detailed information for a specific machine.
Path Parameters
Machine ID
Response
Single machine object with same fields as GET all, plus additional details.Get Machine History
VIEW_MACHINES
Returns status change history for a machine.
Path Parameters
Machine ID
Response
Array of status change events
Example Response
Update Machine Status
MANAGE_MACHINES
Updates a machine’s operational status.
Path Parameters
Machine ID
Request Body
New status: Operativa, Mantenimiento, Fuera de servicio
Detailed reason for status change (minimum 10 characters)
Business Rules
- Status changes are logged in machine history with full audit trail
- Cannot change status to the same value (must be different)
- Motivo is mandatory for all status changes
- User and timestamp are automatically recorded
Example Request
cURL
Example Response
Machine Status Values
Operativa (Operational)
- Machine is running and available for production
- Can be assigned to production orders
- Production records can be logged
Mantenimiento (Maintenance)
Fuera de servicio (Out of Service)
Integration with Production
Machine status affects production tracking:- Status Validation: Production records are validated against machine status
- Downtime Tracking: Status changes trigger downtime (paro) records
- Capacity Planning: Status affects weekly production planning
- Shift Logs: Machine status is displayed in bit\u00e1cora dashboards
Best Practices
Detailed Motivos: Provide specific reasons for status changes including:
- Type of maintenance (preventive, corrective, emergency)
- Failure description if applicable
- Expected return to service time
- Work performed
Error Responses
404 Not Found
Machine ID not found:
400 Bad Request
Invalid status value or missing motivo:
403 Forbidden
Insufficient permissions:
Related Endpoints
- Paros (Downtime) API - Track machine downtime events
- Bit\u00e1cora API - Shift-level machine monitoring
- Planning API - Machine capacity planning