curl -sS -X POST "$BMA_BASE_URL/v1/mcp_oauth_authorizations" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID" \
-H "Idempotency-Key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'{
"id": "<string>",
"type": "mcp_oauth_authorization",
"status": "pending",
"mcp_server_url": "<string>",
"vault_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"authorization_url": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"credential_id": "<string>",
"error_code": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}MCP OAuth
Start an MCP OAuth authorization
Starts the flow for mcp_server_url; the user opens authorization_url, and the completed flow stores the credential in vault_id.
POST
/
v1
/
mcp_oauth_authorizations
curl -sS -X POST "$BMA_BASE_URL/v1/mcp_oauth_authorizations" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID" \
-H "Idempotency-Key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'{
"id": "<string>",
"type": "mcp_oauth_authorization",
"status": "pending",
"mcp_server_url": "<string>",
"vault_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"authorization_url": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"credential_id": "<string>",
"error_code": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}请求头
请求体
application/json
响应
Created.