API (phimi-api)
Available today: GET /healthz, GET /readyz (checks PostgreSQL), GET /metrics,
GET /api/v1 (service and version). phimi-api migrate applies migrations and exits.
Planned contract (phase 4)
REST for business operations, WebSocket for live events. User authentication is independent of device identity; access is granted per tracker; history is paginated and requests are rate limited.
| Endpoint | Method | Use |
|---|---|---|
/api/v1/pets | GET / POST | list and create profiles |
/api/v1/devices | GET | list trackers |
/api/v1/devices/{id} | GET | tracker details |
/api/v1/devices/{id}/position | GET | latest position |
/api/v1/devices/{id}/positions | GET | history for a period |
/api/v1/devices/{id}/commands | POST | configuration command |
/api/v1/devices/{id}/commands/{cmdId} | GET | command status |
/api/v1/geofences | GET / POST | zones |
/api/v1/alerts | GET | alert history |
/api/v1/stream | WebSocket | live positions and events |
Proposed WebSocket message (a Phimi contract, not a native V53 message; values are illustrative):
{
"type": "device.position.updated",
"deviceId": "device-uuid",
"timestamp": "2026-11-13T16:30:00Z",
"position": { "latitude": 47.36, "longitude": 8.62, "source": "gps", "speedKmh": 1.4 },
"telemetry": { "batteryPercent": 72, "signalStrength": 20, "satellites": 13 }
}