OAuth2 callback — exchanges code for tokens
const url = 'http://localhost:11044/api/v1/auth/oauth2/callback';const options = {method: 'GET', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The authorization code the provider appends to its redirect, exchanged here for tokens; missing (without error) is a 400
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
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
Responses
Section titled “Responses”HTML page reporting a provider-side failure or a failed token exchange
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
The consent screen sat too long and the flow expired. The body is an HTML page

