获取指定 Credential 的详情。响应为 Credential 对象,auth 中的敏感值已脱敏。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
GET /credentials/{credential_id}
路径参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
credential_id | 是 | string | Credential ID,格式 cred_xxx |
请求示例
响应
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | Credential ID,格式 cred_xxx |
type | string | 固定为 credential |
vault_id | string | 所属 Vault ID |
display_name | string | Credential 可读名称 |
auth | object | 认证信息,敏感值已脱敏(如 secret_value、token、access_token 不返回) |
auth.type | string | 认证类型:environment_variable、static_bearer 或 mcp_oauth |
auth.secret_name | string | 环境变量名称(environment_variable 类型) |
auth.networking | object | 网络策略(environment_variable 类型) |
auth.mcp_server_url | string | MCP Server 地址(static_bearer / mcp_oauth 类型) |
auth.expires_at | string | Token 过期时间,ISO 8601(mcp_oauth 类型) |
metadata | object | 业务自定义键值对 |
archived_at | string | null | 归档时间,未归档时为 null |
created_at | string | 创建时间,ISO 8601 |
updated_at | string | 最近更新时间,ISO 8601 |
request_id | string | 请求唯一标识 |
错误码
| 状态码 | 错误码 | 说明 |
|---|---|---|
| 400 | InvalidParameter | Required parameter missing or invalid. |
| 401 | InvalidApiKey | Invalid API-key provided. |