MCPBundler Docs
MCPBundler Docs
Volver al marketplacePrimeros PasosAutenticacionTutorial - De un Bundle a un Agente Conectado
API Reference
Agent A2A Tools
Agent Channels
Agent Configuration (Staging)
Agent Configuration (Versions)
Agent Tools
Agents
Auth
Billing
Bundler
Bundler Tool
Bundles
Call Campaigns
Catalog
Conversations
Credentials
Deployments
Discover
Embedding
Fleet
Knowledge Bases
LLM
MCP Listings
Media
OAuth Clients
OAuth2
Initiate OAuth2 FlowOAuth2 Callback
Observability
Organisations
Realtime
Reviews
Roadmap
SCIM
STT
Suppression
Triggers
TTS
Users
Utils
Voices
Webhooks
Workflows
API ReferenceOAuth2

OAuth2 Callback

GET
/v1/oauth2/callback

Complete the PKCE flow: exchange the code, then create-or-update the grant.

The identity provider redirects the end user's browser here after they authorize (or deny) access, with no authenticated request context of its own - the caller's identity and every other piece of context this needs to complete the exchange travels entirely inside state, decoded by _decode_state. A missing, tampered, or expired state is rejected outright.

On success, the grant's credential is created (or, for a reconnect of the same provider account, updated in place) via oauth_credential_provider.upsert_grant - this is the only creation path for an oauth2_pkce credential, since the frontend never holds the real token to POST to the normal credential-create route. When the initiating request named a deployment/entry, the result is also auto-linked via bundle_deployment_provider.link_credential.

Args: session: Database session. code: Authorization code issued by the provider. state: Opaque value echoed back from initiate_oauth. error: Provider-reported error code, if the user denied access or the request otherwise failed upstream. error_description: Human-readable detail accompanying error.

Returns: A redirect to the frontend's stored redirect_uri, with either oauth_success=1 or oauth_error=<message> appended.

Query Parameters

code*Code
state*State
error?string|null
error_description?string|null

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/oauth2/callback?code=string&state=string"
null
{  "detail": [    {      "loc": [        "string"      ],      "msg": "string",      "type": "string"    }  ]}

Initiate OAuth2 Flow

Previous Page

Observability

Endpoints in the Observability group.