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 (or cursor) 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 what doctl agents logs uses; paginate it with replay_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_id string required

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

The session UUID.

Query Parameters

replayOnly boolean optional

Example: false

Write 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.

Default: false

replayFrom string optional

Event-id pagination cursor for the replay_only lane 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.

cursor string optional

Query-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.

deviceId string optional

Query-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-ID string optional

Example: 01K9YQ0R2M4A7X

The 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-UUID string optional

Example: d1e2f3a4-b5c6-7890-abcd-ef1234567890

A stable per-install device id. See device_id.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.agents.sessions
    .bySession_id("a1b2c3d4-e5f6-7890-abcd-ef1234567890").events.get();

More Information

See /v2/agents/sessions/{session_id}/events in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.