> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vivix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# session.closed

会话关闭时，服务会尝试在断开其余控制连接之前发送此事件。收到该事件后，请停止发送控制指令并清理本地媒体资源。但不要只依赖此事件：如果连接已经关闭，客户端可能无法收到它。此事件表示实时交互已经结束，但异步资源清理可能仍在进行。请通过查询会话接口获取权威的生命周期状态。

## 事件字段

**event\_id** `string` *required*

此服务端事件的唯一 ID。

**type** `string` *required*

事件类型：`session.closed`。

**session\_id** `string` *required*

已关闭会话的 ID。

**reason** `string` *required*

会话关闭的原因。

```json session.closed theme={null}
{
  "type": "session.closed",
  "event_id": "evt_123",
  "session_id": "d411368c-714e-4951-9a28-c11c083d07d8",
  "reason": "interaction_idle_timeout"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.