Skip to content

OAuth2 callback — exchanges code for tokens

GET
/api/v1/auth/oauth2/callback
curl --request GET \
--url http://localhost:11044/api/v1/auth/oauth2/callback \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Landing for the provider redirect; renders a human-readable HTML result page rather than JSON.

code
string

The authorization code the provider appends to its redirect, exchanged here for tokens; missing (without error) is a 400

state
string

The opaque flow id this server issued at authorize and the provider echoes back; it must match a live flow on this instance, so an expired one is a 410 and one this instance never issued is a 400

error
string

The provider’s error code when the user declined or consent failed (e.g. access_denied); when present the flow stops and an HTML failure page is returned

HTML page reporting a provider-side failure or a failed token exchange

Media typetext/html
string

Authorized: back to the chat view, which reads ?authorized=

Missing code or state, a state this instance never issued, or a flow whose user or provider is gone. The body is HTML text

Media typetext/html
string

The consent screen sat too long and the flow expired. The body is an HTML page

Media typetext/html
string