Get Alerts
Retrieve smart alerts generated by the AI-powered pattern detection system. Alerts are automatically created when concerning patterns are detected, such as high turnover risk, burnout indicators, or negative sentiment trends.Authentication
Requires authentication andadmin role authorization.
Query Parameters
Filter alerts by status. Possible values:
nueva- New, unviewed alerts (default)en_proceso- Alerts being actively addressedresuelta- Resolved alertsdescartada- Dismissed alerts
Maximum number of alerts to return (default: 20)
Request Example
Response
Indicates if the request was successful
Response message
Response data object
Response Example
Mark Alert as Viewed
Update an alert’s status to indicate it has been reviewed by an administrator.Authentication
Requires authentication andadmin role authorization.
Path Parameters
Unique identifier of the alert to mark as viewed
Request Example
Response
Indicates if the request was successful
Response message
Response data object containing the updated alert
Response Example
Alert Generation Patterns
SmartAlerts are automatically generated by analyzing multiple data sources. The system detects the following patterns:1. High Risk Survey
Triggered when a single survey shows high risk (score ≥ 70). Implementation:diagnosticService.js:402-434
Recommendations:
- Schedule individual interview with supervisor
- Evaluate current workload
2. Continuous Risk Pattern
Triggered when an employee has 3+ medium/high risk surveys in the last 3 weeks. Implementation:diagnosticService.js:541-582
Recommendations:
- Immediate intervention with direct supervisor
- Occupational psychological evaluation
3. Increasing Risk Trend
Triggered when risk scores show an upward trend over 2+ weeks. Implementation:diagnosticService.js:771-833
Recommendations:
- Intensive weekly monitoring
- Identify recent stress factors
4. Negative Sentiment Pattern
Triggered when AI text analysis detects 2+ negative sentiments with high risk scores (≥60) in 2 weeks. Implementation:diagnosticService.js:631-667
Recommendations:
- Individual emotional support session
- Review workplace stress factors
5. Low Participation (Department-Level)
Triggered when department participation falls below 30% in the last week. Implementation:diagnosticService.js:585-629
Recommendations:
- Awareness campaign about survey importance
- Review platform accessibility
The system runs pattern detection automatically after each survey is processed and can also be triggered manually via scheduled jobs.
Auto-Escalation
Alerts withseverity: "critica" are automatically escalated to higher management.
Implementation: smartAlertSchema.methods.autoEscalate() in models/SmartAlert.js:90-99
When auto-escalated:
escalatedflag is set totrue- Entry added to
escalationHistorywith reason “Escalación automática por severidad crítica” - Escalated to “direccion_medica” (medical director)
Confidence Scores
Each alert includes a confidence score (0-1) indicating the reliability of the pattern detection:- 0.9: Very high confidence (e.g., low participation with clear metrics)
- 0.8-0.85: High confidence (e.g., sentiment analysis, risk patterns)
- 0.75: Medium-high confidence (e.g., trend detection with limited data points)
Recommendation Assignment
Recommendations are automatically assigned to roles based on the action category:| Category | Assigned Role |
|---|---|
| Emotional support | mentor |
| Training | rh (Human Resources) |
| Recognition | supervisor |
| Mentoring | mentor |
| Rest/time off | supervisor |
diagnosticService.js:874-883.
Use Cases
- Proactive Intervention: Address employee issues before turnover occurs
- Resource Prioritization: Focus HR efforts on highest-risk employees
- Pattern Recognition: Identify systemic issues affecting multiple employees
- Compliance: Document wellness monitoring and intervention efforts
- Analytics: Track alert resolution effectiveness over time
Related Endpoints
- Quick Survey - Submit surveys that may generate alerts
- Wellness Heatmap - View department-level wellness overview