GET /api/v1/cloud/vaults/{vault_id}/credentials
获取指定 Vault 下的凭证列表。默认不返回已归档凭证。
请求头
| 头部 | 必选 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <PAT> |
路径参数
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
vault_id | string | 是 | Vault 的唯一标识符 |
查询参数
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
limit | integer | 否 | 每页返回数量上限。默认 20,范围 1-100。超过 100 返回 400 invalid_request_error |
page | string | 否 | Claude 风格的向后翻页游标,等价于 after_id;与 before_id、after_id 互斥 |
after_id | string | 否 | 游标分页:返回此 ID 之后的记录。与 page、before_id 互斥 |
before_id | string | 否 | 游标分页:返回此 ID 之前的记录。与 page、after_id 互斥 |
include_archived | boolean | 否 | 设为 true 时包含已归档凭证 |
name | string | 否 | 按 MCP 服务器 URL 搜索凭证 |
示例请求
示例响应
HTTP 200 OK响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
data | array | Vault credential 对象数组 |
next_page | string | null | 下一页向后游标;has_more 为 true 时传给 page |
first_id | string | null | 当前页第一条记录 ID |
last_id | string | null | 当前页最后一条记录 ID |
has_more | boolean | 是否还有更多记录 |
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 凭证唯一标识符(vcred_ 前缀) |
type | string | 固定为 "vault_credential" |
vault_id | string | 所属 Vault 的 ID |
auth | object | 脱敏后的鉴权信息;不会返回密文 |
display_name | null | 当前固定为 null |
metadata | object | 与 credential 一起存储的自定义元数据对象;省略时为 {} |
archived_at | string | null | 归档时间;active 时为 null |
created_at | string | 创建时间(ISO 8601) |
updated_at | string | 最后更新时间(ISO 8601) |
错误码
| HTTP | type | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | limit 非法,或同时传入多个 page、before_id、after_id |
| 401 | authentication_error | 缺少或无效的认证令牌 |
| 404 | not_found_error | Vault 不存在或无权访问 |
注意事项
- 凭证列表中不会返回任何密文
- 默认不返回已归档凭证;传
include_archived=true可包含已归档凭证
相关
Vaults
安全地存储凭据并注入到 Agent Session。