Skip to main content

List Notifications

Listing notifications in Nexla allows you to view and manage all system alerts, status updates, and operational messages. The system provides comprehensive filtering and search capabilities to help you find relevant notifications quickly and efficiently.

Notification Listing Overview

The notification listing system provides flexible access to all notifications across your platform, enabling you to monitor system health, track resource status, and respond to operational issues effectively.

List All Notifications

Retrieve all notifications to get a comprehensive view of system events and status changes.

Basic Listing Endpoint

To retrieve all your notifications:

GET /notifications
List All Notifications: Request
GET /notifications

Response Structure

The response includes comprehensive notification information with all relevant details:

List All Notifications: Response
[
{
"id": 5007,
"owner": {
"id": 42,
"full_name": "John Smith",
"email": "john.smith@example.com"
},
"org": {
"id": 101,
"name": "Acme Corporation",
"email_domain": "acme.com"
},
"access_roles": ["owner"],
"level": "INFO",
"resource_id": 1002,
"resource_type": "SOURCE",
"message_id": 0,
"message": "Data source connected successfully",
"read_at": null,
"updated_at": "2023-01-15T21:04:48.000Z",
"created_at": "2023-01-15T21:04:48.000Z"
},
{
"id": 5008,
"owner": {
"id": 42,
"full_name": "John Smith",
"email": "john.smith@example.com"
},
"org": {
"id": 101,
"name": "Acme Corporation",
"email_domain": "acme.com"
},
"access_roles": ["owner"],
"level": "INFO",
"resource_id": 3001,
"resource_type": "SET",
"message_id": 0,
"message": "New datasets available for processing",
"read_at": null,
"updated_at": "2023-01-15T21:05:48.000Z",
"created_at": "2023-01-15T21:05:48.000Z"
}
]

Filtering Notifications

Use advanced filtering to focus on specific types of notifications and events.

Filter by Read Status

Filter notifications by their read status to focus on unread alerts:

Filter by Read Status: Request
GET /notifications?read=0

Filter by Resource Type

Filter notifications by specific resource types to focus on relevant alerts:

Filter by Resource Type: Request
GET /notifications?resource_type=SOURCE

Filter by Severity Level

Filter notifications by severity level to focus on critical issues:

Filter by Severity Level: Request
GET /notifications?level=ERROR

Filter by Resource ID

Filter notifications for a specific resource to track its status:

Filter by Resource ID: Request
GET /notifications?resource_id=1002

Combined Filtering

Combine multiple filters for precise notification targeting:

Combined Filtering: Request
GET /notifications?read=0&resource_type=SOURCE&level=ERROR&resource_id=1002

Time-Based Filtering

Filter notifications by time ranges to focus on recent or historical events.

Filter by Date Range

Filter notifications within specific time periods:

Filter by Date Range: Request
GET /notifications?from=2023-01-01T00:00:00&to=2023-01-31T23:59:59

Filter by Recent Activity

Focus on notifications from recent time periods:

Filter by Recent Activity: Request
GET /notifications?from=2023-01-15T00:00:00

Pagination and Sorting

Manage large numbers of notifications efficiently with pagination and sorting.

Pagination

Use pagination to handle large notification collections:

Pagination: Request
GET /notifications?page=1&per_page=50

Sorting Options

Sort notifications by various criteria for better organization:

Sorting: Request
GET /notifications?sort_by=created_at&sort_order=DESC

Available Sort Fields

Sort notifications by various attributes:

  • created_at: Sort by notification creation time
  • updated_at: Sort by last update time
  • level: Sort by severity level
  • resource_type: Sort by resource type
  • read_at: Sort by read status

Search Functionality

Find specific notifications quickly using search capabilities.

Search notifications by message content and descriptions:

Text Search: Request
GET /notifications?search=connection

Combine search with other filters for precise results:

Advanced Search: Request
GET /notifications?search=error&level=ERROR&read=0

Notification Response Fields

Understanding the notification response structure helps you effectively process and manage alerts.

Basic Information

Essential notification identification and metadata:

  • id: Unique notification identifier
  • message: Human-readable notification message
  • level: Severity level (DEBUG, INFO, WARN, ERROR)
  • created_at: When the notification was created
  • updated_at: When the notification was last updated

Resource Information

Details about the resource associated with the notification:

  • resource_id: ID of the related resource
  • resource_type: Type of resource (SOURCE, SET, SINK, FLOW)
  • message_id: Internal message identifier

Status and Access

Notification status and access control information:

  • read_at: When the notification was marked as read (null if unread)
  • access_roles: User's access level to this notification
  • owner: User who owns the notification
  • org: Organization the notification belongs to

Filtering and Search Parameters

Available query parameters for filtering and searching notifications.

Status Parameters

Filter by notification status:

  • read: Filter by read status (0 for unread, 1 for read)
  • level: Filter by severity level (DEBUG, INFO, WARN, ERROR)

Resource Parameters

Filter by resource characteristics:

  • resource_type: Filter by resource type (SOURCE, SET, SINK, FLOW)
  • resource_id: Filter by specific resource ID

Time Parameters

Filter by time ranges:

  • from: Start time for filtering (ISO 8601 format)
  • to: End time for filtering (ISO 8601 format)

Pagination Parameters

Control result pagination:

  • page: Page number (default: 1)
  • per_page: Results per page (default: 20, max: 100)

Sorting Parameters

Control result ordering:

  • sort_by: Field to sort by (default: created_at)
  • sort_order: Sort direction (ASC or DESC, default: DESC)

Search Parameters

Text search capabilities:

  • search: Search term for message content

Best Practices

To effectively list and manage notifications:

  1. Use Appropriate Filters: Apply filters to focus on relevant notifications
  2. Implement Pagination: Use pagination for large notification collections
  3. Regular Review: Periodically review and respond to notifications
  4. Search Efficiently: Use search to find specific notifications quickly
  5. Monitor Trends: Analyze notification patterns for system optimization

Error Handling

Common notification listing 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
  • Pagination Issues: Check page and per_page parameter values

After listing notifications, you may need to:

Update Notification Status

PUT /notifications/{notification_id}/read
PUT /notifications/{notification_id}/unread

Delete Notifications

DELETE /notifications/{notification_id}

Get Notification Counts

GET /notifications/count

View Notification Details

GET /notifications/{notification_id}