---
title: "List Sessions"
method: GET
path: "/mle-agent/sessions"
tags: ["agent-chat-sessions"]
---

# List Sessions

`GET /mle-agent/sessions`

List chat sessions for the authenticated user.

Args:
    request: FastAPI request used by the rate-limiter.
    auth: Authenticated caller (read-only).
    service: Chat-session service.
    limit: Page size.
    offset: Page offset.
    include_archived: Whether to include archived sessions.

Returns:
    ChatSessionListResponse sorted by updated_at descending.

## Query parameters

- `limit` integer — Number of sessions to return
- `offset` integer — Offset for pagination
- `include_archived` boolean — Include archived sessions

## Response `200`

Successful Response

- ChatSessionListResponse — Response model for listing chat sessions.
  - `success` boolean
  - `sessions` ChatSessionResponse[], required
    - `id` string, required
    - `user_id` string, required
    - `title` string, required
    - `created_at` string, required
    - `updated_at` string, required
    - `is_archived` boolean
    - `project_id` string, nullable
    - `images_retention_days` integer, nullable — Per-session image retention window in days for this chat's image attachments. NULL inherits the 30-day default; 0 means keep forever. Drives image eviction by the nightly cleanup job.
    - `modal_sandbox_id` string, nullable — Modal sandbox id for the persistent MLE agent runtime, if a sandbox is associated with this session. Surfaced for nightly smoke tests and observability — never used for client routing.
    - `first_user_attached_resources` AttachedResourceRef[] — Resource chips the user attached to the *first* user message of this session, parsed from its attached-context preamble. Powers the threads-sidebar preview so users can see at a glance what context a thread was anchored on without opening it. Empty when the session has no user messages or none of them carry a preamble.
      - `id` string, required — Type-prefixed resource id used by the frontend chip rendering. For example ``dataset:abc-123`` or ``model:tj-99``.
      - `name` string, required — Human-readable label rendered inside the chip.
      - `type` string, required — Resource type slug — one of ``dataset``, ``model``, ``evaluation``, or ``base-model``.
  - `count` integer, required
  - `total` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/revisions/31dfe831e079/schema)
