Incidents API
The Incidents API manages production incidents reported during shifts. Incidents track quality issues, equipment failures, safety events, and other deviations from normal operations.Authentication
All write endpoints requireMANAGE_PRODUCTION permission. Read endpoints require authentication.
Get All Incidents
Response
Array of incident objects.Incident ID
Incident title/summary
Detailed incident description
Severity level: Baja, Media, Alta
Incident state: Abierto, En investigación, Cerrado
Affected process ID (1-9)
Affected process name
Shift when incident occurred: T1, T2, T3
ISO timestamp of incident occurrence
Username of person who reported the incident
Corrective action taken (null until closed)
ISO timestamp of incident closure (null if open)
Example Request
cURL
JavaScript
Example Response
Create Incident
MANAGE_PRODUCTION
Reports a new production incident.
Request Body
Brief incident title/summary (max 200 characters)
Detailed description of what happened, impact, and context
Severity level:
Baja- Minor issue, no production impactMedia- Moderate impact, requires attentionAlta- Critical issue, immediate action required
ID of affected process (1-9)
Shift when incident occurred: T1, T2, or T3
ISO timestamp of incident occurrence (defaults to current time if not provided)
Username of reporter (defaults to authenticated user if not provided)
Example Request
cURL
JavaScript
Example Response
Update Incident
MANAGE_PRODUCTION
Updates an existing incident, typically to add investigation details or close with corrective action.
Path Parameters
Incident ID
Request Body
All fields are optional. Only provided fields will be updated.Update state: Abierto, En investigación, Cerrado
Corrective action taken (required when closing incident)
Update description with additional findings
Update severity if initial assessment was incorrect
Business Rules
- When changing state to
Cerrado,accion_correctivais mandatory - Closing an incident automatically sets
fecha_cierreto current timestamp - Cannot reopen a closed incident (must create new incident if issue recurs)
Example Request - Close Incident
cURL
Example Response
Incident State Machine
State Transitions:Abierto→En investigación: When investigation startsEn investigación→Cerrado: When root cause identified and corrective action completedAbierto→Cerrado: For minor incidents requiring immediate action
Severity Guidelines
Alta (High)
Media (Medium)
- Equipment malfunctions causing delays but not complete stoppage
- Quality deviations detected before shipment
- Process parameter excursions
- Requires investigation within 24 hours
Baja (Low)
- Minor operational issues
- Cosmetic defects
- Brief delays or interruptions
- Can be addressed during normal operations
Integration with Shift Logs
Incidents are integrated with the Bitácora (shift log) system:- Inline Reporting: For Extrusor PP, incidents can be recorded directly within process data using the
incidentesarray:
- Closure Validation: Shifts with open high-severity incidents may require supervisor approval before closure.
- Traceability: Incidents are linked to specific shifts, processes, and production batches for full traceability.
Best Practices
Detailed Descriptions: Include:
- What happened (observable facts)
- When it happened (precise time if possible)
- Where it happened (specific equipment/location)
- Immediate actions taken
- Material/production affected
Common Workflows
Equipment Failure
Quality Deviation
Error Responses
400 Bad Request
Missing required fields or invalid data:
404 Not Found
Incident ID not found:
403 Forbidden
Insufficient permissions:
Related Endpoints
- Bitácora API - Shift log management
- Quality API - Quality sample tracking
- Audit Logs - Incident audit trail