---
title: "List all sessions"
method: GET
path: "/api/sessions/"
tags: ["sessions"]
---

# List all sessions

`GET /api/sessions/`

List sessions with optional pagination and search.

Args:
    limit: Maximum number of sessions to return (default 100, max 500).
    offset: Number of sessions to skip (default 0).
    q: Optional search query to filter by title or work_dir.
    archived: Filter by archived status.
        - None (default): Only return non-archived sessions.
        - True: Only return archived sessions.

## Query parameters

- `limit` integer
- `offset` integer
- `q` string, nullable
- `archived` boolean, nullable

## Response `200`

Successful Response

- Session[]
  - `session_id` string, uuid, required — Session unique ID
  - `title` string, required — Session title derived from kimi-cli history
  - `last_updated` string, date-time, required — Last updated timestamp
  - `is_running` boolean — Whether the session is running
  - `status` SessionStatus — Runtime status of a web session.
    - `session_id` string, uuid, required — Session unique ID
    - `state` 'stopped' | 'idle' | 'busy' | 'restarting' | 'error', required — Current session state
    - `seq` integer, required — Monotonic sequence number
    - `worker_id` string, nullable — Worker instance ID
    - `reason` string, nullable — Reason for the state transition
    - `detail` string, nullable — Additional detail for debugging
    - `updated_at` string, date-time, required — Timestamp for this state
  - `work_dir` string, nullable — Working directory for the session
  - `session_dir` string, nullable — Session directory path
  - `archived` boolean — Whether the session is archived

## Other responses

- `422` — Validation Error

## Changes

- **2026-07-17** `8eac348b2e66` — 2 info
  - added the new optional `query` request parameter `archived`
  - added the optional property `items/archived` to the response with the `200` status
- **2026-02-04** `0843dee5b725` — 4 info
  - added the new optional `query` request parameter `limit`
  - added the new optional `query` request parameter `offset`
  - added the new optional `query` request parameter `q`
  - added the non-success response with the status `422`
- **2026-01-29** `c455806f620b` — 5 warning, 1 info
  - deleted the `query` request parameter `archived`
  - deleted the `query` request parameter `limit`
  - deleted the `query` request parameter `offset`
  - deleted the `query` request parameter `q`
  - …2 more

[Change history](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface/changes/api/sessions/get.md)

---

[API](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface.md) · [All operations](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/moonshotai/kimi-code-cli-web-interface/revisions/8eac348b2e66/schema)
