Skip to main content

Endpoint

Authentication

Requires a valid JWT with dispatch:assign permission.

Request Body

{
  "lat": 38.7169,
  "lng": -9.1395,
  "vertical": "healthcare",
  "event_type": "CARDIAC",
  "priority": "P1_CRITICAL",
  "required_equipment": ["AED", "VENTILATOR"]
}
FieldTypeRequiredDescription
latnumberYesEvent latitude
lngnumberYesEvent longitude
verticalstringNoEvent vertical — filters by capability
event_typestringNoSpecific event type within the vertical
prioritystringNoSeverity — P1_CRITICAL, HIGH, MEDIUM, LOW
required_equipmentstring[]NoEquipment codes required for this event

Response

{
  "scored": [
    {
      "team_id": "uuid",
      "team_name": "Alpha Medical",
      "status": "available",
      "vertical": "healthcare",
      "distance_km": 2.4,
      "eta_min": 4,
      "equipment_match": 0.95,
      "member_availability": 1.0,
      "score": 0.08,
      "recommended": true,
      "channel": "internet",
      "position": {
        "lat": 38.73,
        "lng": -9.15,
        "source": "gps",
        "last_seen": "2026-05-27T10:00:00Z"
      }
    }
  ],
  "count": 3
}

Score Algorithm

The score engine runs identically on the API (online) and SDK (offline). Lower score is better.
ComponentDescription
travel_scoreHaversine distance normalised to 30 min max
capability_scoreEquipment and vertical match — lower is better match
member_scoreMember availability ratio — lower is more available
load_penalty0.5 if team is on_mission, 0 otherwise
geofence_penalty0.2 if event is outside team zone boundary, 0 otherwise

Position Sources

SourceDescription
gpsReal GPS from a team member, updated within 10 minutes
zoneZone center coordinates — used when no fresh GPS is available
unknownNo position data — team is still scored but distance is 0

Offline Compatibility

This algorithm runs identically on the SDK without a server connection. When offline, the SDK uses the last known member positions and zone boundaries stored locally.