Skip to main content

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.

EndpointMethodUse
/api/v1/petsGET / POSTlist and create profiles
/api/v1/devicesGETlist trackers
/api/v1/devices/{id}GETtracker details
/api/v1/devices/{id}/positionGETlatest position
/api/v1/devices/{id}/positionsGEThistory for a period
/api/v1/devices/{id}/commandsPOSTconfiguration command
/api/v1/devices/{id}/commands/{cmdId}GETcommand status
/api/v1/geofencesGET / POSTzones
/api/v1/alertsGETalert history
/api/v1/streamWebSocketlive 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 }
}