Validate Credential
post /v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate
Validate Credential
Path Parameters
-
vault_id: string -
credential_id: string
Header Parameters
-
"anthropic-beta": optional array of AnthropicBeta可选的请求头,用于指定要使用的 beta 版本。
-
string -
"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more-
"message-batches-2024-09-24" -
"prompt-caching-2024-07-31" -
"computer-use-2024-10-22" -
"computer-use-2025-01-24" -
"pdfs-2024-09-25" -
"token-counting-2024-11-01" -
"token-efficient-tools-2025-02-19" -
"output-128k-2025-02-19" -
"files-api-2025-04-14" -
"mcp-client-2025-04-04" -
"mcp-client-2025-11-20" -
"dev-full-thinking-2025-05-14" -
"interleaved-thinking-2025-05-14" -
"code-execution-2025-05-22" -
"extended-cache-ttl-2025-04-11" -
"context-1m-2025-08-07" -
"context-management-2025-06-27" -
"model-context-window-exceeded-2025-08-26" -
"skills-2025-10-02" -
"fast-mode-2026-02-01" -
"output-300k-2026-03-24" -
"user-profiles-2026-03-24" -
"advisor-tool-2026-03-01" -
"managed-agents-2026-04-01" -
"cache-diagnosis-2026-04-07"
-
-
Returns
-
BetaManagedAgentsCredentialValidation object { credential_id, has_refresh_token, mcp_probe, 5 more }对凭据配置的 MCP 服务器进行实时探测的结果。
-
credential_id: string已验证凭据的唯一标识符。
-
has_refresh_token: boolean凭据是否配置了刷新令牌。
-
mcp_probe: BetaManagedAgentsMCPProbeMCP 验证探测中失败的步骤。
-
http_response: BetaManagedAgentsRefreshHTTPResponse凭据验证探测期间捕获的 HTTP 响应。
-
body: string响应正文。可能被截断,敏感值已清除。
-
body_truncated: booleanbody是否被截断。 -
content_type: stringContent-Type响应头的值。 -
status_code: numberHTTP 状态码。
-
-
method: string失败的 MCP 方法(例如
initialize或tools/list)。
-
-
refresh: BetaManagedAgentsRefreshObject凭据验证期间尝试的刷新令牌交换结果。
-
http_response: BetaManagedAgentsRefreshHTTPResponse凭据验证探测期间捕获的 HTTP 响应。
-
status: "succeeded" or "failed" or "connect_error" or "no_refresh_token"凭据验证期间尝试的刷新令牌交换结果。
-
"succeeded" -
"failed" -
"connect_error" -
"no_refresh_token"
-
-
-
status: BetaManagedAgentsCredentialValidationStatus凭据验证探测的总体判定。
-
"valid" -
"invalid" -
"unknown"
-
-
type: "vault_credential_validation""vault_credential_validation"
-
validated_at: stringRFC 3339 格式的时间戳
-
vault_id: string包含凭据的保险库的标识符。
-
Example
curl https://api.anthropic.com/v1/vaults/$VAULT_ID/credentials/$CREDENTIAL_ID/mcp_oauth_validate \
-X POST \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
Response
{
"credential_id": "vcrd_011CZkZEMt8gZan2iYOQfSkw",
"has_refresh_token": true,
"mcp_probe": {
"http_response": {
"body": "body",
"body_truncated": true,
"content_type": "content_type",
"status_code": 0
},
"method": "method"
},
"refresh": {
"http_response": {
"body": "body",
"body_truncated": true,
"content_type": "content_type",
"status_code": 0
},
"status": "succeeded"
},
"status": "valid",
"type": "vault_credential_validation",
"validated_at": "2026-03-15T10:00:00Z",
"vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv"
}