Skip to main content

Notifications API

The Notifications API provides endpoints for retrieving predictive alerts and notifications generated by the system when anomalies or potential issues are detected.

Endpoints Overview

MethodEndpointDescription
GET/notificationsList all notifications
GET/notifications/{id}Get a specific notification

List Notifications

Retrieves a list of notifications with optional filtering and feedback enrichment.

Endpoint: GET /notifications

Authentication: Required

Query Parameters:

ParameterTypeDescription
companyNamestringFilter by company name
siteNamestringFilter by site name
sensorIDstringFilter by sensor identifier
timestampstringFilter by timestamp (ISO 8601)
includeFeedbackbooleanInclude related feedback data (true or false)
limitintegerMaximum number of results (default: 100)

Response:

{
"items": [
{
"id": "notif-123",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"sensorID": "sensor-456",
"assetName": "Pump A1",
"timestamp": "2024-10-15T14:30:00Z",
"type": "anomaly",
"severity": "warning",
"title": "Elevated Vibration Detected",
"message": "Vibration levels have exceeded normal thresholds on Pump A1",
"status": "open",
"feedbackID": "feedback-789",
"createdAt": "2024-10-15T14:30:05Z",
"updatedAt": "2024-10-15T14:30:05Z"
}
],
"count": 1,
"nextToken": "eyJpZCI6Im5vdGlmLTEyMyJ9"
}

Response with Feedback Enrichment:

When includeFeedback=true, related feedback data is included:

{
"items": [
{
"id": "notif-123",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"sensorID": "sensor-456",
"assetName": "Pump A1",
"timestamp": "2024-10-15T14:30:00Z",
"type": "anomaly",
"severity": "warning",
"title": "Elevated Vibration Detected",
"message": "Vibration levels have exceeded normal thresholds on Pump A1",
"status": "resolved",
"feedbackID": "feedback-789",
"feedback": {
"id": "feedback-789",
"rating": "accurate",
"failureMode": "bearing_wear",
"actionTaken": "Replaced bearing",
"comments": "Bearing showed signs of wear during inspection",
"createdAt": "2024-10-16T09:00:00Z"
},
"createdAt": "2024-10-15T14:30:05Z",
"updatedAt": "2024-10-16T09:00:00Z"
}
],
"count": 1
}

Example Request:

curl -X GET "https://api.acme.f7i.ai/prod/notifications?companyName=Acme%20Corp&includeFeedback=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Get Notification

Retrieves a specific notification by ID with optional feedback enrichment.

Endpoint: GET /notifications/{id}

Authentication: Required

Path Parameters:

ParameterTypeDescription
idstringUnique identifier of the notification

Query Parameters:

ParameterTypeDescription
includeFeedbackbooleanInclude related feedback data

Response:

{
"id": "notif-123",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"sensorID": "sensor-456",
"assetName": "Pump A1",
"timestamp": "2024-10-15T14:30:00Z",
"type": "anomaly",
"severity": "warning",
"title": "Elevated Vibration Detected",
"message": "Vibration levels have exceeded normal thresholds on Pump A1",
"status": "open",
"feedbackID": "feedback-789",
"metadata": {
"vibration_rms": 4.56,
"threshold": 3.0,
"modelVersion": "1.2.0"
},
"createdAt": "2024-10-15T14:30:05Z",
"updatedAt": "2024-10-15T14:30:05Z"
}

Example Request:

curl -X GET "https://api.acme.f7i.ai/prod/notifications/notif-123?includeFeedback=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Notification Types

  • anomaly: Unusual pattern detected by predictive models
  • threshold: Value exceeded configured threshold
  • trend: Concerning trend identified over time
  • maintenance: Maintenance recommendation
  • system: System-generated notification

Severity Levels

  • info: Informational, no action required
  • warning: Attention recommended
  • critical: Immediate action required

Status Values

  • open: New notification, not yet addressed
  • acknowledged: Notification has been seen
  • in_progress: Issue is being investigated
  • resolved: Issue has been addressed
  • dismissed: Notification was dismissed (false positive)

Error Responses

400 Bad Request

{
"error": "Invalid request",
"details": {
"timestamp": "Invalid timestamp format"
}
}

404 Not Found

{
"error": "Item not found"
}

500 Internal Server Error

{
"error": "Internal server error: [error details]"
}