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

请求头

头部必选说明
AuthorizationBearer <PAT>

路径参数

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

查询参数

参数类型必选说明
limitinteger每页返回数量上限。默认 20,范围 1-100。超过 100 返回 400 invalid_request_error
pagestringClaude 风格的向后翻页游标,等价于 after_id;与 before_idafter_id 互斥
after_idstring游标分页:返回此 ID 之后的记录。与 pagebefore_id 互斥
before_idstring游标分页:返回此 ID 之前的记录。与 pageafter_id 互斥
include_archivedboolean设为 true 时包含已归档凭证
namestring按 MCP 服务器 URL 搜索凭证
完整分页规范详见 分页

示例请求

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",
      "type": "vault_credential",
      "vault_id": "vault_019e3bb940277f0db05ab74291acf6ef",
      "auth": {
        "type": "static_bearer",
        "mcp_server_url": "https://example.com/mcp"
      },
      "display_name": null,
      "metadata": {
        "team": "docs"
      },
      "archived_at": null,
      "created_at": "2026-05-18T15:34:16.876188Z",
      "updated_at": "2026-05-18T15:34:16.876188Z"
    }
  ],
  "next_page": null,
  "first_id": "vcred_019e3bb940297658a632dbf920057eff",
  "last_id": "vcred_019e3bb940297658a632dbf920057eff",
  "has_more": false
}

响应字段

字段类型说明
dataarrayVault credential 对象数组
next_pagestring | null下一页向后游标;has_moretrue 时传给 page
first_idstring | null当前页第一条记录 ID
last_idstring | null当前页最后一条记录 ID
has_moreboolean是否还有更多记录
VaultCredential 对象:
字段类型说明
idstring凭证唯一标识符(vcred_ 前缀)
typestring固定为 "vault_credential"
vault_idstring所属 Vault 的 ID
authobject脱敏后的鉴权信息;不会返回密文
display_namenull当前固定为 null
metadataobject与 credential 一起存储的自定义元数据对象;省略时为 {}
archived_atstring | null归档时间;active 时为 null
created_atstring创建时间(ISO 8601)
updated_atstring最后更新时间(ISO 8601)

错误码

HTTPtype触发条件
400invalid_request_errorlimit 非法,或同时传入多个 pagebefore_idafter_id
401authentication_error缺少或无效的认证令牌
404not_found_errorVault 不存在或无权访问

注意事项

  • 凭证列表中不会返回任何密文
  • 默认不返回已归档凭证;传 include_archived=true 可包含已归档凭证
完整错误信封说明详见 错误参考

相关

Vaults

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