{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/anthropic/main/json-schema/anthropic-beta-managed-agents-credential-validation-schema.json",
  "title": "BetaManagedAgentsCredentialValidation",
  "description": "Result of live-probing a credential against its configured MCP server.",
  "x-generated": "2026-09-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anthropic-vaults-api-openapi.yml#/components/schemas/BetaManagedAgentsCredentialValidation",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "credential_id",
    "vault_id",
    "status",
    "validated_at",
    "has_refresh_token",
    "mcp_probe",
    "refresh"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "vault_credential_validation"
      ]
    },
    "credential_id": {
      "description": "Unique identifier of the credential that was validated.",
      "type": "string"
    },
    "vault_id": {
      "description": "Identifier of the vault containing the credential.",
      "type": "string"
    },
    "status": {
      "description": "Overall verdict of the validation probe.",
      "allOf": [
        {
          "$ref": "#/$defs/BetaManagedAgentsCredentialValidationStatus"
        }
      ]
    },
    "validated_at": {
      "description": "When the validation probe was performed.",
      "allOf": [
        {
          "$ref": "#/$defs/BetaTimestamp"
        }
      ]
    },
    "has_refresh_token": {
      "description": "Whether the credential has a refresh token configured.",
      "type": "boolean"
    },
    "mcp_probe": {
      "description": "Details of the failing MCP probe step. Null when the probe succeeded.",
      "anyOf": [
        {
          "$ref": "#/$defs/BetaManagedAgentsMcpProbe"
        },
        {
          "type": "null"
        }
      ]
    },
    "refresh": {
      "description": "Details of the refresh-token exchange attempted on a 401. Null when no refresh was attempted.",
      "anyOf": [
        {
          "$ref": "#/$defs/BetaManagedAgentsRefreshObject"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "BetaManagedAgentsCredentialRefreshStatus": {
      "type": "string",
      "description": "Outcome of a refresh-token exchange attempted during credential validation.",
      "enum": [
        "succeeded",
        "failed",
        "connect_error",
        "no_refresh_token"
      ]
    },
    "BetaManagedAgentsCredentialValidationStatus": {
      "type": "string",
      "description": "Overall verdict of a credential validation probe.",
      "enum": [
        "valid",
        "invalid",
        "unknown"
      ]
    },
    "BetaManagedAgentsMcpProbe": {
      "description": "The failing step of an MCP validation probe.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "method",
        "http_response"
      ],
      "properties": {
        "method": {
          "description": "The MCP method that failed (for example `initialize` or `tools/list`).",
          "type": "string"
        },
        "http_response": {
          "description": "The captured HTTP error response. Null when no HTTP response was received (timeout, DNS, TLS).",
          "anyOf": [
            {
              "$ref": "#/$defs/BetaManagedAgentsRefreshHttpResponse"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "BetaManagedAgentsRefreshHttpResponse": {
      "description": "An HTTP response captured during a credential validation probe.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status_code",
        "content_type",
        "body",
        "body_truncated"
      ],
      "properties": {
        "status_code": {
          "description": "HTTP status code.",
          "type": "integer",
          "format": "int32"
        },
        "content_type": {
          "description": "Value of the `Content-Type` response header.",
          "type": "string"
        },
        "body": {
          "description": "Response body. May be truncated and has sensitive values scrubbed.",
          "type": "string"
        },
        "body_truncated": {
          "description": "Whether `body` was truncated.",
          "type": "boolean"
        }
      }
    },
    "BetaManagedAgentsRefreshObject": {
      "description": "Outcome of a refresh-token exchange attempted during credential validation.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "http_response"
      ],
      "properties": {
        "status": {
          "description": "Outcome of the refresh attempt.",
          "allOf": [
            {
              "$ref": "#/$defs/BetaManagedAgentsCredentialRefreshStatus"
            }
          ]
        },
        "http_response": {
          "description": "The captured HTTP error response from the token endpoint. Populated only when `status` is `failed`.",
          "anyOf": [
            {
              "$ref": "#/$defs/BetaManagedAgentsRefreshHttpResponse"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "BetaTimestamp": {
      "description": "A timestamp in RFC 3339 format",
      "type": "string",
      "format": "date-time"
    }
  }
}