Notification Counts
Notification counts in Nexla provide quick summaries and statistics about your notification landscape, helping you understand the volume and distribution of alerts across different categories and time periods.
Count Overview
Notification counts give you immediate insight into your platform's operational status, allowing you to quickly assess the number of unread alerts, error conditions, and overall notification volume without retrieving full notification details.
Get Notification Counts
Retrieve notification counts to get quick summaries of your notification landscape.
Count Endpoint
To get notification counts:
GET /notifications/count
- Nexla API
GET /notifications/count
Basic Count Response
The response provides the total count of all notifications:
- Nexla API
{
"count": 156
}
Filtered Counts
Use filters to get counts for specific notification subsets.
Count by Read Status
Get counts of read and unread notifications:
- Nexla API
GET /notifications/count?read=0
- Nexla API
{
"count": 23
}
Count by Severity Level
Get counts for specific severity levels:
- Nexla API
GET /notifications/count?level=ERROR
- Nexla API
{
"count": 5
}
Count by Resource Type
Get counts for specific resource types:
- Nexla API
GET /notifications/count?resource_type=SOURCE
- Nexla API
{
"count": 67
}
Count by Resource ID
Get counts for specific resources:
- Nexla API
GET /notifications/count?resource_id=1002
- Nexla API
{
"count": 12
}
Combined Filter Counts
Combine multiple filters for precise counting:
- Nexla API
GET /notifications/count?read=0&level=ERROR&resource_type=SOURCE
- Nexla API
{
"count": 3
}
Time-Based Counts
Get notification counts for specific time periods.
Count by Date Range
Get counts within specific time periods:
- Nexla API
GET /notifications/count?from=2023-01-01T00:00:00&to=2023-01-31T23:59:59
- Nexla API
{
"count": 89
}
Count Recent Notifications
Get counts for recent time periods:
- Nexla API
GET /notifications/count?from=2023-01-15T00:00:00
- Nexla API
{
"count": 34
}
Advanced Count Queries
Use advanced queries for comprehensive counting scenarios.
Count with Search
Combine search terms with counting:
- Nexla API
GET /notifications/count?search=connection&level=ERROR
- Nexla API
{
"count": 2
}
Count by Multiple Resource Types
Get counts across multiple resource types:
- Nexla API
GET /notifications/count?resource_type=SOURCE&resource_type=SINK
- Nexla API
{
"count": 89
}
Count Use Cases
Notification counts serve various operational and monitoring purposes.
Operational Monitoring
Use counts for daily operational monitoring:
- Unread Alert Count: Quickly assess how many alerts need attention
- Error Volume: Monitor the number of error conditions
- Resource Status: Track notifications by resource type
- Trend Analysis: Compare counts over time for pattern recognition
Dashboard Integration
Integrate counts into monitoring dashboards:
- Real-Time Metrics: Display current notification counts
- Status Indicators: Use counts as health indicators
- Alert Thresholds: Set thresholds based on count values
- Performance Monitoring: Track notification volume trends
Reporting and Analytics
Use counts for reporting and analysis:
- Daily Summaries: Generate daily notification summaries
- Performance Reports: Include notification metrics in reports
- Capacity Planning: Use counts for resource planning
- Compliance Reporting: Track notification patterns for compliance
Count Response Structure
Understanding the count response helps you process the information effectively.
Response Format
The count response is simple and focused:
count: Integer representing the number of notifications matching the criteria- Status: HTTP status code indicating success or failure
- Headers: Standard HTTP headers with response metadata
Count Accuracy
Count responses provide accurate real-time information:
- Real-Time Data: Counts reflect current notification state
- Filter Accuracy: Counts accurately apply all specified filters
- Consistency: Counts are consistent with full notification listings
- Performance: Counts are optimized for fast retrieval
Best Practices
To effectively use notification counts:
- Use Appropriate Filters: Apply filters to get relevant counts
- Monitor Trends: Track count changes over time
- Set Thresholds: Establish thresholds for automated alerting
- Regular Monitoring: Check counts regularly for operational awareness
- Integration: Integrate counts into monitoring dashboards
Error Handling
Common count-related issues and solutions:
- Permission Denied: Ensure you have appropriate access rights
- Invalid Parameters: Verify query parameters are correctly formatted
- Resource Not Found: Confirm the specified resource exists
- Parameter Conflicts: Resolve conflicts between filter parameters
Related Operations
After getting notification counts, you may need to:
List Notifications
GET /notifications
GET /notifications?read=0
Filter Notifications
GET /notifications?level=ERROR
GET /notifications?resource_type=SOURCE
Update Notifications
PUT /notifications/{notification_id}/read
PUT /notifications/bulk_read
Delete Notifications
DELETE /notifications/{notification_id}