AnthropicClaude 托管智能体
校验凭据 MCP OAuth
校验保险库中一条 MCP OAuth 凭据是否仍然有效。
POST
/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate◐ 部分支持请求参数
vault_idstring必填path: 保险库 ID(路径或查询参数)。
credential_idstring必填path: 路径参数:凭据 ID。
vault_idstring必填query: 保险库 ID(路径或查询参数)。
返回
400
只适用于 OAuth 凭据,对其他类型返回 400。结果总是 HTTP 200,status 为 valid、invalid 或 unknown;mcp_probe 只在未通过时给出失败的一步,refresh 只在尝试了续期时给出。
错误按 Claude Managed Agents 格式返回,参见 错误码
响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| credential_id | string | Unique identifier of the credential that was validated. |
| has_refresh_token | boolean | Whether the credential has a refresh token configured. |
| mcp_probe | null | object | The failing step of an MCP validation probe. |
| mcp_probe.http_response | null | object | An HTTP response captured during a credential validation probe. |
| mcp_probe.method | string | The MCP method that failed (for example `initialize` or `tools/list`). |
| refresh | null | object | Outcome of a refresh-token exchange attempted during credential validation. |
| refresh.http_response | null | object | An HTTP response captured during a credential validation probe. |
| refresh.status | string | Outcome of a refresh-token exchange attempted during credential validation. - `succeeded` - The token endpoint returned a new access token. - `failed` - The token endpoint returned an error response. See `http_response` for detail. - `connect_error` - The token endpoint could not be reached (DNS, TLS, or connection error). - `no_refresh_token` - No refresh token is stored for the credential, so no exchange was attempted. |
| status | string | Overall verdict of a credential validation probe. |
| type | string | |
| validated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault containing the credential. |
示例前提
此示例针对前面创建的 static 凭据,因此实测返回 400 invalid_request_error。要获得校验结果,请先通过一键授权完成用户授权,再将 credential_id 换成产生的 OAuth Secret ID。校验 OAuth 凭据返回 HTTP 200,状态为 valid、invalid 或 unknown。