---
title: "Update session"
method: PATCH
path: "/api/sessions/{session_id}"
tags: ["sessions"]
---

# Update session

`PATCH /api/sessions/{session_id}`

Update a session (e.g., rename title or archive/unarchive).

## Path parameters

- `session_id` string, uuid, required

## Request body

- UpdateSessionRequest — Update session request.
  - `title` string, nullable
  - `archived` boolean, nullable — Archive or unarchive the session

## Response `200`

Successful Response

- Session — Web UI session metadata.
  - `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 request property `archived`
  - added the optional property `archived` to the response with the `200` status
- **2026-02-04** `0843dee5b725` — 1 info
  - endpoint added
- **2026-01-29** `c455806f620b` — 1 breaking
  - api removed without deprecation

[Change history](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface/changes/api/sessions/:session_id/patch.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)
