Create an OAuth connect URL for a native custom-agent MCP connection
Creates a browser OAuth login URL for one native custom-agent MCP connection. Use after saving the MCP row when the server authMode is oauth.
POST
/agents/{id}/native/mcp-connections/{connectionId}/oauth-connect-urlAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredconnectionIdstringrequiredRequest body
requiredapplication/jsonoauthClientIdobjectOAuth client id for advanced OAuth setup.
oauthClientSecretobjectOAuth client secret for advanced OAuth setup. Write-only.
returnUrlobjectBrowser URL to return to after OAuth completes.
Responses
201
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/agents/string/native/mcp-connections/string/oauth-connect-url" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"oauthClientId": {},
"oauthClientSecret": {},
"returnUrl": {}
}'const response = await fetch("https://leadtime.app/api/public/agents/string/native/mcp-connections/string/oauth-connect-url", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"oauthClientId": {},
"oauthClientSecret": {},
"returnUrl": {}
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/agents/string/native/mcp-connections/string/oauth-connect-url",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"oauthClientId": {},
"oauthClientSecret": {},
"returnUrl": {}
},
)Response
No example response.
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions