curl -sS -X POST "$BMA_BASE_URL/v1/vaults/vlt_zppdgwodanyrnl7ee7tsokkpta/credentials/vcrd_5gcylxgccz62vh57oz32pprj44/mcp_oauth_validate" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"type": "vault_credential_validation",
"credential_id": "vcrd_5gcylxgccz62vh57oz32pprj44",
"vault_id": "vlt_zppdgwodanyrnl7ee7tsokkpta",
"status": "invalid",
"has_refresh_token": true,
"mcp_probe": {
"method": "initialize",
"http_response": {
"status_code": 401,
"content_type": "application/json",
"body": "{\"error\":\"invalid_token\"}",
"body_truncated": false
}
},
"refresh": {
"status": "failed",
"http_response": {
"status_code": 400,
"content_type": "application/json",
"body": "{\"error\":\"invalid_grant\",\"error_description\":\"Refresh token revoked\"}",
"body_truncated": false
}
},
"validated_at": "2026-11-21T09:44:18.205731Z"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}Validate an MCP OAuth credential
Checks an active mcp_oauth credential against its MCP server while the request waits: BMA sends the MCP initialize and tools/list requests with the stored access token. When the server answers 401 and the credential has refresh settings, BMA exchanges the refresh token at the token endpoint, stores the new access token (with the new refresh token and expiry when the endpoint returns them) if the exchange succeeds, and probes again. status is valid when the probe succeeds, invalid when the server or the token endpoint rejects the grant, and unknown when the cause may be transient (no answer, a 5xx or 429). Captured response bodies are truncated and have secret values removed. Outbound requests go only to public addresses and do not follow redirects. The call is not idempotent: a successful refresh replaces the stored token. Any other credential type, or an archived credential, is a 400 invalid_request_error without an error.code; an unknown credential, or one in another vault or workspace, is a 404 not_found_error without an error.code.
Authorization: Organization API key (x-api-key: bma_org_v1_…), personal access token (Authorization: Bearer bma_pat_v1_…), signed-in user token or dashboard session; user credentials name the organization with bma-organization-id. The request acts in one workspace: the one named by bma-workspace-id, which may be left out when the credential resolves to a single workspace (the workspace an API key is bound to, or a member’s only workspace). The caller’s workspace role must be admin or developer (organization owners and admins act as workspace admins in every workspace of their organization); operators and viewers are refused, as are machine, executor and session credentials.
Limits:
- Each outbound HTTP request (the two probe requests, the refresh exchange and the two probe requests that follow it) times out after 10 seconds.
- Captured response bodies are cut to 4 KiB; at most 1 MiB of a response is read.
- Rate limit: one request of the organization’s write budget (Rate limits).
Errors (besides the common errors (401 authentication, 429 rate_limited, 500)):
| Status | error.type | error.code | Cause | Fix |
|---|---|---|---|---|
| 400 | invalid_request_error | organization_required | A personal access token or user token names no organization with bma-organization-id. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | project_required | The credential can use several workspaces and the request names none with bma-workspace-id. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | workspace_id_conflict | bma-workspace-id and anthropic-workspace-id name different workspaces. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 403 | permission_error | permission_denied | The caller’s workspace role is operator or viewer, or the credential is neither an organization API key nor a user credential. | Use a credential with the required role or access; retrying with the same credential will not help. |
curl -sS -X POST "$BMA_BASE_URL/v1/vaults/vlt_zppdgwodanyrnl7ee7tsokkpta/credentials/vcrd_5gcylxgccz62vh57oz32pprj44/mcp_oauth_validate" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"type": "vault_credential_validation",
"credential_id": "vcrd_5gcylxgccz62vh57oz32pprj44",
"vault_id": "vlt_zppdgwodanyrnl7ee7tsokkpta",
"status": "invalid",
"has_refresh_token": true,
"mcp_probe": {
"method": "initialize",
"http_response": {
"status_code": 401,
"content_type": "application/json",
"body": "{\"error\":\"invalid_token\"}",
"body_truncated": false
}
},
"refresh": {
"status": "failed",
"http_response": {
"status_code": 400,
"content_type": "application/json",
"body": "{\"error\":\"invalid_grant\",\"error_description\":\"Refresh token revoked\"}",
"body_truncated": false
}
},
"validated_at": "2026-11-21T09:44:18.205731Z"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}Headers
Path Parameters
Response
Success.
The outcome of a live check of an mcp_oauth credential against its MCP server.
valid: the MCP server accepted the token (after a refresh, if one was needed). invalid: the server answered 401 or 403 and no refresh helped, or the token endpoint rejected the refresh with a 4xx other than 429. unknown: the cause may be transient (no answer, another status, a 5xx or 429 from the token endpoint, or a token endpoint that could not be reached).
valid, invalid, unknown