# Fire Incidents API

Manage fire incident alerts and notifications within the Exit WeWeb Portal system.

# Endpoints

# List Fire Incidents

GET /fire_incidents

Returns fire incidents based on your role and location filters.

Query Parameters:

  • select - Columns to return
  • state - Filter by state (eq, in)
  • city - Filter by city (eq, ilike)
  • incident_date - Filter by date (eq, gte, lte)
  • processed - Filter by processing status (eq)
  • incident_type - Filter by type (eq, ilike)
  • order - Sort results
  • limit - Limit results
  • offset - Pagination offset

Example Request:

GET /fire_incidents?select=*&state=eq.NY&processed=eq.false&order=incident_date.desc
Authorization: Bearer YOUR_TOKEN
apikey: YOUR_ANON_KEY

Response:

[
  {
    "id": 1,
    "incident_id": "2025-001",
    "incident_type": "FIRE",
    "incident_date": "2025-01-22",
    "state": "NY",
    "city": "New York",
    "address": "123 Main St",
    "latitude": 40.7128,
    "longitude": -74.0060,
    "processed": false,
    "processed_at": null,
    "raw_data": {},
    "created_at": "2025-01-22T10:00:00Z"
  }
]

# Fire Incident Object

interface FireIncident {
  id: number;
  incident_id: string;
  incident_type: string;
  incident_date: string;
  state: string;
  city: string;
  address: string;
  building_name?: string;
  latitude?: number;
  longitude?: number;
  processed: boolean;
  processed_at?: string;
  raw_data: object;
  created_at: string;
  updated_at: string;
}

# Related Edge Functions

The fire incident system uses several Edge Functions:

  1. fetch-fire-alerts - Fetches incidents from 1rwn.com API
  2. get-building-owner-actovia - Gets owner info from Actovia
  3. send-fire-alert-notification - Sends email/SMS notifications
  4. process-fire-incidents - Orchestrates the workflow

See the Edge Functions documentation for details.