Events
Device events — state changes, faults, log lines, and any other non-numeric
data sent with px.event(name, data) or as a point with "class": "event".
Query events
/v1/sources/{source_id}/eventsQuery 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 and limit. |
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/events?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": {}
}
]metric is the event name. 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/events?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}/events/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. The old /logs/stream path also still works.
To send events, see Send logs and events.