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

> 根据 ID 获取单个 Vault 的详细信息。

`GET /api/v1/cloud/vaults/{vault_id}`

根据 ID 获取单个 Vault 的详细信息。

## 请求头

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

## 路径参数

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

## 示例请求

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

## 示例响应

**HTTP 200 OK**

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

## 响应字段

| 字段             | 类型             | 说明                       |
| -------------- | -------------- | ------------------------ |
| `id`           | string         | Vault 唯一标识符（`vault_` 前缀） |
| `type`         | string         | 资源类型，固定为 `"vault"`       |
| `display_name` | string         | 显示名称                     |
| `metadata`     | object         | 自定义元数据                   |
| `archived_at`  | string \| null | 归档时间；active 时为 `null`    |
| `created_at`   | string         | 创建时间（ISO 8601）           |
| `updated_at`   | string         | 最后更新时间（ISO 8601）         |

## 错误码

| HTTP | type                   | 触发条件                                               |
| ---- | ---------------------- | -------------------------------------------------- |
| 401  | `authentication_error` | 缺少或无效的认证令牌                                         |
| 404  | `not_found_error`      | Vault 不存在或无权访问：`Vault '{vault_id}' was not found.` |

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

## 相关

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