dots.v2.agents.sessions.get()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

client.v2.agents.sessions.get(requestConfiguration?: RequestConfiguration<SessionsRequestBuilderGetQueryParameters>): Promise<undefined | Definitions_list_sessions_response>

Description

Keyset-paginated on an opaque cursor. Results are scoped to the authenticated team. Destroyed and failed sessions are omitted by default (matching the Cloud Console); pass status=SESSION_STATUS_ALL to list every session regardless of status, or an explicit status such as status=SESSION_STATUS_FAILED or status=SESSION_STATUS_DESTROYED to list only those.

Parameters

pageSize integer optional

Example: 50

Page size. Defaults to 50 when omitted or non-positive; values above 200 are clamped to 200 (not rejected).

Default: 50

Min: 1

Max: 200

pageToken string optional

Opaque keyset cursor returned by the previous page. Empty starts from the beginning.

status string optional

Optional filter on session status. Empty / SESSION_STATUS_UNSPECIFIED means no explicit filter, which still hides destroyed and failed sessions by default; SESSION_STATUS_ALL opts out and returns every session regardless of status (no session is ever actually in this status; it only means something as a filter value here); any other explicit status overrides the default.

One of: SESSION_STATUS_UNSPECIFIED, SESSION_STATUS_PROVISIONING, SESSION_STATUS_READY, SESSION_STATUS_DETACHED, SESSION_STATUS_DESTROYING, SESSION_STATUS_DESTROYED, SESSION_STATUS_FAILED, SESSION_STATUS_PAUSED, SESSION_STATUS_ALL, SESSION_STATUS_LOCKED

Default: SESSION_STATUS_UNSPECIFIED

name string optional

Example: demo-agent

Optional exact-name filter (case-insensitive). Returns the single live (non-terminal) session that currently holds this name for the caller's team, or an empty list if none does. Matches the live holder only, so historical terminal rows and reused names never make it ambiguous (per-team live-name uniqueness bounds it to at most one). This is how clients (doctl / Console) resolve a session name to its id; the {session_id} path stays UUID-only.

search string optional

Example: demo

Optional case-insensitive substring filter on session name (contains), for callers that don't know the exact name (e.g. a UI search box). Unlike name, this may return zero, one, or many sessions, including terminal ones. Independent of name; at most 64 characters.

Max length: 64

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.get();

Response Example

Show Response Example
{
  "sessions": [
    {
      "session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "demo-agent",
      "parent_session_id": "example",
      "fork_id": "11111111-2222-3333-4444-555555555555",
      "fork_from_checkpoint_id": "example",
      "agent_kind": "AGENT_KIND_UNSPECIFIED",
      "status": "SESSION_STATUS_UNSPECIFIED",
      "sandbox_id": "example",
      "created_at": "2026-08-01T12:00:00Z",
      "last_event_at": "2026-08-01T12:00:00Z",
      "keep_warm": false,
      "resume_on_topoff": false,
      "pause_reason": "example",
      "idle_timeout_seconds": 60,
      "repo_hint": "example",
      "warnings": [],
      "config_id": "11111111-2222-3333-4444-555555555555",
      "openai_session_id": "example",
      "openai_environment_id": "example",
      "region": "ric1",
      "workspace_id": "019a2f4e-8c1d-7b3a-9e5f-2d6c8a1b4e70"
    }
  ],
  "next_page_token": "example"
}

More Information

See /v2/agents/sessions 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.