跳转到主要内容
GET /v1/vaults/{vault_id}/credentials 获取指定 Vault 下的凭证列表。默认不返回已归档凭证。

请求头

头部必选说明
AuthorizationBearer <PAT>

路径参数

参数类型必选说明
vault_idstringVault 的唯一标识符

查询参数

参数类型必选说明
limitinteger每页返回数量上限
after_idstring游标分页:返回此 ID 之后的记录
before_idstring游标分页:返回此 ID 之前的记录
include_archivedboolean设为 true 时包含已归档凭证
namestring按 MCP 服务器 URL 搜索凭证
created_at[gte]string仅返回创建时间大于或等于该 RFC 3339 时间戳的凭证
created_at[lte]string仅返回创建时间小于或等于该 RFC 3339 时间戳的凭证
完整分页规范详见 分页

示例请求

curl -X GET "https://api.qoder.com/api/v1/cloud/vaults/vault_019e3bb940277f0db05ab74291acf6ef/credentials" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "vcred_019e3bb940297658a632dbf920057eff",
      "vault_id": "vault_019e3bb940277f0db05ab74291acf6ef",
      "mcp_server_url": "https://example.com/mcp",
      "protocol": "streamable_http",
      "type": "static_bearer",
      "status": "active",
      "created_at": "2026-05-18T15:34:16.876188Z",
      "updated_at": "2026-05-18T15:34:16.876188Z"
    }
  ],
  "first_id": "vcred_019e3bb940297658a632dbf920057eff",
  "last_id": "vcred_019e3bb940297658a632dbf920057eff",
  "has_more": false
}

响应字段

字段类型说明
dataarrayVault credential 对象数组
first_idstring | null当前页第一条记录 ID
last_idstring | null当前页最后一条记录 ID
has_moreboolean是否还有更多记录
VaultCredential 对象:
字段类型说明
idstring凭证唯一标识符(vcred_ 前缀)
vault_idstring所属 Vault 的 ID
mcp_server_urlstringMCP 服务器 URL
protocolstring协议:streamable_http
typestring凭证类型:static_bearer
statusstring状态:activearchived
archived_atstring归档时间;仅归档后返回
created_atstring创建时间(ISO 8601)
updated_atstring最后更新时间(ISO 8601)

错误码

HTTPtype触发条件
401authentication_error缺少或无效的认证令牌
404not_found_errorVault 不存在或无权访问

注意事项

  • 凭证列表中不会返回 access_token 的值(出于安全考虑)
  • 默认不返回已归档凭证;传 include_archived=true 可包含已归档凭证
完整错误信封说明详见 错误参考

相关

Vaults

安全地存储凭据并注入到 Agent Session。