Skip to main content

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
Get Notification Counts: Request
GET /notifications/count

Basic Count Response

The response provides the total count of all notifications:

Get Notification Counts: Response
{
"count": 156
}

Filtered Counts

Use filters to get counts for specific notification subsets.

Count by Read Status

Get counts of read and unread notifications:

Count Unread Notifications: Request
GET /notifications/count?read=0
Count Unread Notifications: Response
{
"count": 23
}

Count by Severity Level

Get counts for specific severity levels:

Count Error Notifications: Request
GET /notifications/count?level=ERROR
Count Error Notifications: Response
{
"count": 5
}

Count by Resource Type

Get counts for specific resource types:

Count Source Notifications: Request
GET /notifications/count?resource_type=SOURCE
Count Source Notifications: Response
{
"count": 67
}

Count by Resource ID

Get counts for specific resources:

Count Resource Notifications: Request
GET /notifications/count?resource_id=1002
Count Resource Notifications: Response
{
"count": 12
}

Combined Filter Counts

Combine multiple filters for precise counting:

Combined Filter Count: Request
GET /notifications/count?read=0&level=ERROR&resource_type=SOURCE
Combined Filter Count: Response
{
"count": 3
}

Time-Based Counts

Get notification counts for specific time periods.

Count by Date Range

Get counts within specific time periods:

Count by Date Range: Request
GET /notifications/count?from=2023-01-01T00:00:00&to=2023-01-31T23:59:59
Count by Date Range: Response
{
"count": 89
}

Count Recent Notifications

Get counts for recent time periods:

Count Recent Notifications: Request
GET /notifications/count?from=2023-01-15T00:00:00
Count Recent Notifications: Response
{
"count": 34
}

Advanced Count Queries

Use advanced queries for comprehensive counting scenarios.

Combine search terms with counting:

Count with Search: Request
GET /notifications/count?search=connection&level=ERROR
Count with Search: Response
{
"count": 2
}

Count by Multiple Resource Types

Get counts across multiple resource types:

Count Multiple Resource Types: Request
GET /notifications/count?resource_type=SOURCE&resource_type=SINK
Count Multiple Resource Types: Response
{
"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:

  1. Use Appropriate Filters: Apply filters to get relevant counts
  2. Monitor Trends: Track count changes over time
  3. Set Thresholds: Establish thresholds for automated alerting
  4. Regular Monitoring: Check counts regularly for operational awareness
  5. 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

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}