v1.2.0

IoT Radar Alert API

Intelligence backend with MongoDB & Telegram discovery.

01

Authentication

Security is enforced via Bearer Tokens. Requests must include the following header if configured in your environment.

Authorization: Bearer <YOUR_API_SECRET>
02

Subscriber Discovery

Dynamic Discovery

The API polls Telegram for new users who have started the bot. Discovered users are automatically saved to MongoDB and will receive all future alerts.

Persistent Storage

Unlike local files, MongoDB ensures that subscribers are remembered indefinitely, even across server restarts or cloud migrations.

03

API Endpoints

POST /alert
Auth Required

Primary endpoint for radar ingestion. Triggers subscriber synchronization and broadcasts notifications to all registered recipients in MongoDB.

Request Body

{
  "angle": 174,
  "distance": 19,
  "status": "ALERT" // "ALERT" | "OK"
}

Response (200)

{ "success": true, "message": "Alert processed and notification sent." }

Response (429)

{ "success": false, "message": "Alert suppressed by rate limiter." }
GET /alerts

Returns a rolling in-memory history of the last 20 verified alerts.

Angle Distance Timestamp
174° 19cm 2026-04-01 16:45:26
GET /health

Returns system diagnostics, including uptime and notification metrics.

{ "status": "OK", "alertsSent": 12, "alertActive": true }