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
| Method | Endpoint | Description |
|---|---|---|
| GET | /notifications | List 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:
| Parameter | Type | Description |
|---|---|---|
companyName | string | Filter by company name |
siteName | string | Filter by site name |
sensorID | string | Filter by sensor identifier |
timestamp | string | Filter by timestamp (ISO 8601) |
includeFeedback | boolean | Include related feedback data (true or false) |
limit | integer | Maximum 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:
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the notification |
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
includeFeedback | boolean | Include 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 modelsthreshold: Value exceeded configured thresholdtrend: Concerning trend identified over timemaintenance: Maintenance recommendationsystem: System-generated notification
Severity Levels
info: Informational, no action requiredwarning: Attention recommendedcritical: Immediate action required
Status Values
open: New notification, not yet addressedacknowledged: Notification has been seenin_progress: Issue is being investigatedresolved: Issue has been addresseddismissed: 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]"
}