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

# 归档 Memory Store

> 归档一个 active 状态的 Memory Store。

`POST /api/v1/cloud/memory_stores/{memory_store_id}/archive`

归档一个 active 状态的 Memory Store，并返回更新后的 [Memory Store 对象](/zh/cloud-agents/api/memory-stores/schemas#memory-store-对象)。

## 请求头

| 头部              | 必选 | 说明             |
| --------------- | -- | -------------- |
| `Authorization` | 是  | `Bearer <PAT>` |

## 路径参数

| 参数                | 类型     | 必选 | 说明                              |
| ----------------- | ------ | -- | ------------------------------- |
| `memory_store_id` | string | 是  | Memory Store ID，前缀为 `memstore_` |

## 示例请求

```bash theme={null}
curl -X POST "https://api.qoder.com/api/v1/cloud/memory_stores/memstore_019e3bb8d50674d9b082b73709c29c87/archive" \
  -H "Authorization: Bearer $QODER_PAT"
```

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "id": "memstore_019e3bb8d50674d9b082b73709c29c87",
  "created_at": "2026-05-18T15:33:49.449Z",
  "name": "doc-test-store",
  "type": "memory_store",
  "updated_at": "2026-05-18T15:34:00.007Z",
  "archived_at": "2026-05-18T15:34:00.007Z",
  "description": "测试用",
  "metadata": {},
  "status": "archived",
  "entry_count": 0,
  "total_size": 0
}
```

## 响应

返回归档后的 [Memory Store 对象](/zh/cloud-agents/api/memory-stores/schemas#memory-store-对象)，`status` 变为 `archived`，`archived_at` 被填充。

## 注意事项

不需要请求体。归档后 Store 仍可读取，但不能继续创建或更新 memory。

## 错误码

| HTTP | type                    | 触发条件                     |
| ---- | ----------------------- | ------------------------ |
| 401  | `authentication_error`  | 缺少或无效的认证令牌               |
| 404  | `not_found_error`       | 指定 ID 的 Memory Store 不存在 |
| 409  | `invalid_request_error` | Memory Store 已归档         |

完整错误信封说明详见 [错误参考](/zh/cloud-agents/api/conventions/errors)。
