API GuidesAlerts & MonitoringOverview

Alerts and Monitoring

SALLY continuously monitors every active route in your fleet, checking for potential issues every 60 seconds. When something needs attention — an approaching HOS limit, a route deviation, severe weather ahead, or a dock delay — SALLY generates an alert and delivers it to dispatchers in real time.

How Monitoring Works

Once you activate a route, SALLY’s monitoring service begins tracking it across 20 alert types in 6 categories. The monitoring loop runs continuously:

  1. Check — Evaluate driver HOS, vehicle position, weather, and schedule against the active route plan
  2. Detect — Identify situations that require dispatcher attention
  3. Alert — Generate an alert with category, priority, and recommended actions
  4. Deliver — Push the alert via SSE, WebSocket, and the alerts API
  5. Track — Record all alerts for audit trail and analytics

Alert Categories

SALLY organizes alerts into six categories:

CategoryDescriptionExample Triggers
HOS_VIOLATIONHours of Service compliance issuesDriver approaching 11-hour drive limit, 14-hour duty limit, 8-hour break requirement
ROUTE_DEVIATIONDriver has left the planned routeUnplanned stop, wrong turn, significant detour
WEATHERSevere weather along the routeWinter storm warning, tornado watch, flooding
MECHANICALVehicle mechanical issuesEngine fault code, tire pressure warning, DEF level low
SCHEDULINGSchedule and timing conflictsLate to appointment, dock delay, delivery window missed
SYSTEMPlatform and integration issuesIntegration failure, system error

Alert Priority Levels

Each alert is assigned a priority that determines how it should be handled:

PriorityUrgencyResponse TimeExamples
CRITICALImmediate action requiredUnder 5 minutesActive HOS violation, accident, vehicle breakdown
HIGHUrgent attention neededUnder 15 minutesApproaching HOS limit (under 30 min), severe weather in path
MEDIUMShould be reviewed soonUnder 1 hourModerate route deviation, appointment at risk
LOWInformationalNext check-inMinor schedule variance, weather advisory

Alert Lifecycle

Every alert moves through a defined status flow:

StatusDescription
ACTIVEAlert is new and requires attention
ACKNOWLEDGEDA dispatcher has seen the alert and is working on it
SNOOZEDAlert is temporarily hidden (resurfaces after snooze duration)
RESOLVEDIssue has been addressed or auto-resolved

Alerts can be auto-resolved by SALLY when the underlying condition clears. For example, if a driver was deviating from the route but returns to the planned path, the route deviation alert resolves automatically.

Quick Start: Checking for Alerts

List all active alerts for your fleet:

curl "https://sally-api.apps.appshore.in/api/v1/alerts?status=ACTIVE" \
  -H "X-API-Key: $SALLY_API_KEY"

JavaScript (fetch):

const response = await fetch(
  "https://sally-api.apps.appshore.in/api/v1/alerts?status=ACTIVE",
  {
    headers: { "X-API-Key": process.env.SALLY_API_KEY },
  }
);
 
const { data: alerts, total } = await response.json();
console.log(`${total} active alerts`);

Response:

{
  "data": [
    {
      "id": "alt_x1y2z3w4",
      "type": "HOS_APPROACHING_LIMIT",
      "category": "HOS_VIOLATION",
      "priority": "HIGH",
      "status": "ACTIVE",
      "title": "Driver approaching 11-hour drive limit",
      "message": "Mike Johnson (TRK-4821) has 45 minutes of drive time remaining on route rte_f8e7d6c5. Next required stop: Rest area on I-70 near Springfield, OH.",
      "driverId": "drv_a1b2c3d4",
      "routePlanId": "rte_f8e7d6c5",
      "metadata": {
        "currentHoursDriven": 10.25,
        "driveTimeRemaining": 0.75,
        "recommendedAction": "PLAN_REST_STOP"
      },
      "createdAt": "2026-02-10T16:15:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 20
}

Real-time Alert Delivery

For the best dispatcher experience, subscribe to real-time alerts instead of polling the API:

  • Server-Sent Events (SSE): GET /api/v1/sse/alerts — One-way stream of alert updates, easy to implement
  • WebSocket: Socket.io connection — Bidirectional communication, supports acknowledgment

See Real-time Events for implementation details.

Alert Analytics

SALLY provides analytics endpoints to help you understand alert patterns and improve operations:

# Get alert statistics
curl "https://sally-api.apps.appshore.in/api/v1/alerts/stats" \
  -H "X-API-Key: $SALLY_API_KEY"

Response:

{
  "total": 156,
  "byStatus": {
    "ACTIVE": 3,
    "ACKNOWLEDGED": 7,
    "RESOLVED": 142,
    "SNOOZED": 4
  },
  "byCategory": {
    "HOS_VIOLATION": 42,
    "ROUTE_DEVIATION": 28,
    "WEATHER": 15,
    "MECHANICAL": 8,
    "SCHEDULING": 63
  },
  "byPriority": {
    "CRITICAL": 5,
    "HIGH": 31,
    "MEDIUM": 72,
    "LOW": 48
  },
  "averageResponseTimeMinutes": 8.3,
  "averageResolutionTimeMinutes": 34.7
}

Additional analytics endpoints:

EndpointDescription
GET /api/v1/alerts/analytics/volumeAlert volume over time
GET /api/v1/alerts/analytics/response-timeResponse time trends
GET /api/v1/alerts/analytics/resolutionResolution rate and time
GET /api/v1/alerts/analytics/top-typesMost common alert types

Guides in This Section