Overview
This endpoint provides a quick way to retrieve the total number of open alerts currently in the UTMStack system. It’s commonly used for dashboard widgets, monitoring displays, and alert metrics.Authorization Required: Include a valid Bearer Token in the Authorization header.
Endpoint Details
GET /api/utm-alerts/count-open-alerts
Method: GET
Authentication: Bearer Token required
Response: Integer count of open alerts
Authentication: Bearer Token required
Response: Integer count of open alerts
Request & Response Examples
Additional Code Examples
Response Details
Successful Response
- Success Response
- Zero Alerts
- Error Response
Status Codes
OK
Successfully retrieved the count of open alerts
Unauthorized
Missing or invalid Bearer token
Internal Server Error
Internal server error while retrieving count
Use Cases
Dashboard Integration
Monitoring and Alerting
Metrics Collection
Performance Considerations
Performance Notes:
- This endpoint is optimized for frequent polling
- Response time is typically under 100ms
- Safe to call every 30-60 seconds for real-time dashboards
- Uses database indexing for fast count operations
- Minimal server resources required
Integration Examples
React Dashboard Component
PowerShell Monitoring Script
Best Practices
Polling Frequency
Polling Frequency
Recommended intervals:
- Real-time dashboards: 30-60 seconds
- Monitoring systems: 2-5 minutes
- Reporting systems: 15-30 minutes
- Avoid polling more frequently than every 15 seconds
Error Handling
Error Handling
Handle failures gracefully:
- Cache the last known count during outages
- Implement exponential backoff for retries
- Set timeout values for requests
- Log failures for troubleshooting
Alerting Thresholds
Alerting Thresholds
Establish meaningful thresholds:
- 0 alerts: All clear status
- 1-10 alerts: Normal operational level
- 11-50 alerts: Elevated attention needed
- 50+ alerts: High volume investigation required