Logs
Device events — state changes, faults, errors, and any structured data sent
via px.event(name, data).
Query logs
GET
/v1/sources/{source_id}/logsQuery params
| Param | Example | Description |
|---|---|---|
last | 1h, 30m, 7d | Relative time window (default: 1h). Units: m, h, d only. |
start | 2026-05-01T00:00:00Z | ISO 8601 start time (pair with end) |
end | 2026-05-02T00:00:00Z | ISO 8601 end time |
tail | 50 | Return the last N events (chronological). Max 10000. Ignores the time window. |
name | device.fault | Filter by event name |
limit | 1000 | Max events to return (default 1000, max 10000) |
Use either last or start/end. If you send both, last wins (no error). tail overrides the time window entirely.
Example
curl "https://api.plexus.company/v1/sources/robot-01/logs?last=1h" \
-H "x-api-key: YOUR_API_KEY"Response
[
{
"timestamp_ms": 1746969600000,
"metric": "device.fault",
"value": "E-stop triggered",
"tags": {}
},
{
"timestamp_ms": 1746969720000,
"metric": "battery.state_change",
"value": "charging",
"tags": {}
}
]value is always a string. When the original event carried a structured
object (e.g. px.event("motor.state_change", {"from": "IDLE", "to": "RUNNING"})),
it arrives JSON-encoded — parse it with JSON.parse(event.value).
Tail example
curl "https://api.plexus.company/v1/sources/robot-01/logs?tail=5" \
-H "x-api-key: YOUR_API_KEY"Live events
For real-time event streaming, connect to the data API’s WebSocket endpoint:
wss://api.plexus.company/v1/sources/{source_id}/logs/streamSend {"type": "auth", "api_key": "plx_..."} as the first frame, then receive
event frames as they arrive. See Live streams for the
full protocol and frame shapes.
Last updated on