---
title: "清空会话消息"
method: DELETE
path: "/sessions/{id}/messages"
tags: ["会话"]
---

# 清空会话消息

`DELETE /sessions/{id}/messages`

删除会话中的所有消息，同时清除 LLM 上下文和聊天历史知识库条目。会话本身保留。

## Path parameters

- `id` string, required

## Response `200`

清空成功

- object

## Other responses

- `400` — 请求参数错误
- `404` — 会话不存在

## Changes

> 62 revisions in range; 8 could not be searched.

- **2026-03-30** `08f8a25fbf1d` — 1 info
  - endpoint added
- **2025-12-16** `edf61e68559d` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/sessions/:id/messages/delete.md)

---

[API](https://skmtc.dev/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.dev/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/a5ce73ad8921/schema)
