Start MCP OAuth flow
import requests
url = "https://api.datagrid.com/v1/organization/mcp-servers/{server_id}/start-oauth"
payload = { "redirect_uri": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirect_uri: '<string>'})
};
fetch('https://api.datagrid.com/v1/organization/mcp-servers/{server_id}/start-oauth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/organization/mcp-servers/{server_id}/start-oauth \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "<string>"
}
'{
"object": "mcp_oauth_start",
"authorization_url": "<string>",
"state": "<string>"
}{
"status_code": 123,
"error": "mcp_oauth_requires_user_principal",
"message": "<string>",
"retryable": false,
"statusCode": 123,
"mitigation": "<string>",
"details": {}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}MCP Servers - Beta
Start MCP OAuth flow
Start an OAuth authorization flow for a registered MCP server and return the URL to redirect the end user to. Requires a user-scoped API key (dg_live_); service keys (dg_svc_) are rejected with mcp_oauth_requires_user_principal.
POST
/
organization
/
mcp-servers
/
{server_id}
/
start-oauth
Start MCP OAuth flow
import requests
url = "https://api.datagrid.com/v1/organization/mcp-servers/{server_id}/start-oauth"
payload = { "redirect_uri": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirect_uri: '<string>'})
};
fetch('https://api.datagrid.com/v1/organization/mcp-servers/{server_id}/start-oauth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/organization/mcp-servers/{server_id}/start-oauth \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "<string>"
}
'{
"object": "mcp_oauth_start",
"authorization_url": "<string>",
"state": "<string>"
}{
"status_code": 123,
"error": "mcp_oauth_requires_user_principal",
"message": "<string>",
"retryable": false,
"statusCode": 123,
"mitigation": "<string>",
"details": {}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the MCP server.
Body
application/json
OAuth redirect URI. HTTPS is required except for loopback (http://localhost, http://127.0.0.1, http://[::1]).
Maximum string length:
2048Response
OAuth flow started
Available options:
mcp_oauth_start URL to redirect the end user to so they can complete the OAuth authorization consent.
Opaque state value bound to this OAuth flow, echoed by the authorization server on the callback for CSRF protection.