1 API & Database
Kurtis Ward edited this page 2026-01-22 22:47:29 -05:00

API Endpoints

Endpoint Method Description
/api/status GET Current mode and service status
/api/mode/:mode POST Switch mode (pager, 433, tcp, stop)
/api/config GET/POST Read/update configuration
/api/pager GET Fetch pager messages (with pagination)
/api/sensors GET Fetch sensor readings (with pagination)
/api/debug GET System debug information
/api/telegram/test POST Send test notification

WebSocket

Connect to /ws for real-time updates:

  • { type: 'pager', data: {...} } — New pager message
  • { type: 'sensor', data: {...} } — New sensor reading
  • { type: 'log', data: {...} } — Debug log entry

Database Schema

Pager Messages

Column Type Description
id INTEGER Primary key
timestamp DATETIME Receive time
capcode TEXT Pager address
protocol TEXT POCSAG512/1200/2400
type TEXT alpha/numeric
message TEXT Decoded content
frequency TEXT Receive frequency

Sensor Data

Column Type Description
id INTEGER Primary key
timestamp DATETIME Receive time
model TEXT Device model
sensor_id TEXT Device ID
temperature REAL Temperature reading
humidity REAL Humidity percentage
battery TEXT Battery status