Skip to Content

Logs

Device events — state changes, faults, errors, and any structured data sent via px.event(name, data).

Query logs

GET/v1/sources/{source_id}/logs

Query params

ParamExampleDescription
last1h, 30m, 7dRelative time window (default: 1h). Units: m, h, d only.
start2026-05-01T00:00:00ZISO 8601 start time (pair with end)
end2026-05-02T00:00:00ZISO 8601 end time
tail50Return the last N events (chronological). Max 10000. Ignores the time window.
namedevice.faultFilter by event name
limit1000Max 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/stream

Send {"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