---
title: "List sessions grouped by agent"
method: GET
path: "/sessions/groups"
tags: ["Sessions"]
---

# List sessions grouped by agent

`GET /sessions/groups`

## Query parameters

- `groupBy` 'agent', required

## Response `200`

OK

- ApiResponseSessionsGroups
  - `success` boolean, required
  - `message` string, nullable
  - `timestamp` string, date-time, required
  - `data` object[]
    - `agent` Agent
      - `id` string, required
      - `title` string, nullable
      - `description` string, nullable
      - `avatar` string, nullable
      - `model` string, nullable
      - `provider` string, nullable
      - `systemRole` string, nullable
      - `chatConfig` object, nullable
      - `params` object, nullable
      - `createdAt` string, date-time, nullable
      - `updatedAt` string, date-time, nullable
      - `accessedAt` string, date-time, nullable
    - `sessions` Session[], required
      - `id` string
      - `title` string, nullable
      - `description` string, nullable
      - `avatar` string, nullable
      - `backgroundColor` string, nullable
      - `agentId` string, nullable
      - `groupId` string, nullable
      - `pinned` boolean, nullable
      - `createdAt` string, date-time, nullable
      - `updatedAt` string, date-time, nullable
    - `total` integer, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden

## Changes

- **2025-09-21** `29cedfcf6ce1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/lobehub/apis/lobechat-openapi/changes/sessions/groups/get.md)

---

[API](https://skmtc.dev/lobehub/apis/lobechat-openapi.md) · [All operations](https://skmtc.dev/lobehub/apis/lobechat-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lobehub/lobechat-openapi/revisions/7be2ebcf191c/schema)
