HTTP Interfaces

REST Telemetry API

Standard HTTP JSON endpoints for devices without direct binary socket access.

1. POST /v1/telemetry

Ingests one or more sensor metrics for a specified device.

Headers

  • Content-Type: application/json
  • x-device-token: YOUR_HARDWARE_TOKEN

Example Request

curl -X POST http://127.0.0.1:3001/v1/telemetry \
  -H "Content-Type: application/json" \
  -H "x-device-token: YOUR_HARDWARE_TOKEN" \
  -d '{
    "device_id": "greenhouse-sensor-01",
    "metrics": {
      "temperature": 28.5,
      "humidity": 65.2,
      "soil_ph": 6.8
    }
  }'

2. GET /health

Healthcheck endpoint used by the Raina CLI and container orchestration.

// 200 OK
{
  "status": "healthy",
  "version": "1.0.0",
  "database": "ok",
  "redis": "ok",
  "timestamp": 1727330000000
}