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

# 更新咏唱引擎云会话

> 就地更新咏唱引擎云会话的状态或元数据。遵循 OpenAI beta 的部分更新约定，使用 POST。

更新会话的状态或元数据。遵循 OpenAI beta 约定，更新使用 `POST` 并应用部分补丁：包含的字段被替换，省略的字段保持不变。

## 接口

```http theme={null}
POST /v1/agents/sessions/{session_id}
```

## 认证

`Authorization: Bearer <api_key>` 或 `Authorization: ApiKey <api_key>`。

## 路径参数

<ParamField path="session_id" type="string" required>
  会话标识符。
</ParamField>

## 请求体

<ParamField body="status" type="string">
  新的会话状态，例如 `active` 或 `archived`。
</ParamField>

<ParamField body="metadata" type="object">
  用于替换的元数据对象。
</ParamField>

## 响应

返回完整的更新后会话（形态同 [获取会话](/api-reference/agent/sessions/get)）。

## 示例

```bash theme={null}
curl -X POST https://agent.example.com/v1/agents/sessions/sess_0198c... \
  -H "Authorization: Bearer $ARIA_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "archived", "metadata": {"resolution": "resolved"}}'
```
