> ## 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.

# 归档 Vault

> 将指定 Vault 设为归档状态，归档后不再参与活跃使用但仍可查询。

`POST /api/v1/cloud/vaults/{vault_id}/archive`

将指定 Vault 设为归档状态。归档后的 Vault 不再参与活跃使用，但仍可查询。

## 请求头

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

## 路径参数

| 参数         | 类型     | 必选 | 说明           |
| ---------- | ------ | -- | ------------ |
| `vault_id` | string | 是  | Vault 的唯一标识符 |

## 示例请求

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

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "id": "vault_019e3bb940277f0db05ab74291acf6ef",
  "type": "vault",
  "display_name": "my-mcp-vault",
  "metadata": {},
  "archived_at": "2026-05-18T15:34:35.630693Z",
  "created_at": "2026-05-18T15:34:16.874877Z",
  "updated_at": "2026-05-18T15:34:35.630693Z"
}
```

## 响应字段变化

响应是 Vault 对象，字段同 [获取 Vault](/zh/cloud-agents/api/vaults/get)。

归档成功后：

* `archived_at` 记录归档时间
* `updated_at` 更新为归档操作时间

## 错误码

| HTTP | type                   | 触发条件           |
| ---- | ---------------------- | -------------- |
| 401  | `authentication_error` | 缺少或无效的认证令牌     |
| 404  | `not_found_error`      | Vault 不存在或无权访问 |

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

## 相关

<CardGroup cols={2}>
  <Card title="Vaults" icon="key" href="/zh/cloud-agents/vaults">
    安全地存储凭据并注入到 Agent Session。
  </Card>
</CardGroup>
