The live endpoint opens a persistent Server-Sent Events (SSE) connection that delivers trace and event updates for a specific agent as they arrive. When your agent is actively running, batches appear on the stream within a second of being written to storage. This is the same stream the Mortem dashboard uses to power the live trace view on the agent detail page.Documentation Index
Fetch the complete documentation index at: https://docs.mortemlabs.com/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
The live endpoint uses a Privy JWT, not an agent API key. This is because the stream is consumed by the dashboard running in the browser, not by the agent itself. The Privy JWT is the same token issued when you log in to the Mortem dashboard. Pass the token in theAuthorization header:
403 Forbidden.
If you are building a custom integration that needs to consume the live stream programmatically from server-side code, contact the Mortem team. The current authentication model is designed for browser-based dashboard consumption.
Path parameters
The agent ID whose live trace updates you want to stream. This is the same
MORTEM_AGENT_ID value used when configuring the SDK.Response
The endpoint responds with200 OK and the following headers:
trace and a JSON-encoded body.
Event format
data value is a JSON string representing a single BufferBatchItem — the same object shape sent in the items array of a batch request. It contains a trace object (full snapshot of the trace state at flush time) and an events array (new events added since the last flush).
Replay on connect
When you first connect, the endpoint replays up to the last 1,000 batches stored for the agent before switching to real-time delivery. This means you see recent history immediately without waiting for new agent activity. The replay events arrive in chronological order before any new live events.Warning events
If the live stream is temporarily interrupted — for example due to a Redis connectivity issue — the endpoint emits awarning event:
Example
The 1,000-batch replay buffer is scoped per agent. Live replay is a convenience feature, not a durable event log. For the full trace record, use the dashboard trace detail view.