dots.v2.agents.sessions.bySession_id().events.get()
Generated on 5 Nov 2026
from DoTs version
v1.23.0
Usage
client.v2.agents.sessions.bySession_id(session_id).events.get(requestConfiguration?: RequestConfiguration<EventsRequestBuilderGetQueryParameters>): Promise<undefined | ArrayBuffer>Description
Opens a text/event-stream of the session’s canonical events, served by the MARS data plane (OHP).
Each frame is event: <type> plus a data: line holding a JSON event envelope; comment lines
(: keepalive) arrive about every 15s and must be ignored. Decode every data: with one envelope
parser and dispatch on the envelope’s type. Every stream opens with a stream.state control frame
(its data is a stream_state).
Delivery is at-least-once: clients MUST de-duplicate and order by event_id (a ULID), never by
seq. The same path serves two modes:
- live attach (default): recent context, then an open stream that stays live until the client
disconnects. Pass
Last-Event-ID(orcursor) to resume strictly after the last event the client already rendered, suppressing the last-N context floor. - finite replay (
replay_only=true): writes a bounded slice of the stored transcript and closes. This is whatdoctl agents logsuses; paginate it withreplay_from.
OHP serves recent history only (bounded by Kafka retention and an event window); it is not an
archive. OHP’s own errors (404/429/500/503) use the DO-standard JSON {id, message, request_id}
envelope (cthulhu#179797 / MARSOHS-2065); the 401 comes from the edge.
Parameters
Path Parameters
session_idstring requiredExample:
a1b2c3d4-e5f6-7890-abcd-ef1234567890The session UUID.
Query Parameters
replayOnlyboolean optionalExample:
falseWrite the selected history and then close the stream, rather than going live. Does not advance the device's delivery cursor, so it never supersedes a live attach from the same device.
replayFromstring optionalEvent-id pagination cursor for the
replay_onlylane only; return events after this one. There is no last-N floor, so a cursor already at the head yields nothing. Ignored on a live attach.cursorstring optionalQuery-param equivalent of
Last-Event-ID, because a browser EventSource cannot set request headers. Takes precedence over the header when both are present. Live-attach lane only.deviceIdstring optionalQuery-param equivalent of
X-Device-UUID. Identifies one client install so its delivery cursor and live slot are its own; a second attach from the same device supersedes the first.
Headers
Last-Event-IDstring optionalExample:
01K9YQ0R2M4A7XThe last event this client rendered (not merely received). Its presence marks the request a reconnect, so OHP serves strictly what follows it with no last-N floor. Persist it only after rendering.
X-Device-UUIDstring optionalExample:
d1e2f3a4-b5c6-7890-abcd-ef1234567890A stable per-install device id. See
device_id.
Request Sample
More Information
See /v2/agents/sessions/{session_id}/events in the API reference for additional detail on responses, headers, parameters, and more.