Finish attaching Google after the Stytch redirect, bound to the current session.
POST
/account/security/oauth/google/complete
const url = 'https://api.siteqwality.com/account/security/oauth/google/complete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"oauth_token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/account/security/oauth/google/complete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "oauth_token": "example" }'Requires X-Stytch-Session-Token so Stytch attaches the OAuth factor to
this member rather than creating a parallel login. Google’s email must
match the session email (case-insensitive) or the request is rejected.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
Complete an in-session OAuth provider attach.
object
oauth_token
required
Token from the Stytch redirect (?token= on the callback URL).
string
Example generated
{ "oauth_token": "example"}Responses
Section titled “ Responses ”Google connected
Media type application/json
object
ok
required
boolean
Example generated
{ "ok": true}Missing session token or email mismatch
Missing or invalid authentication
Endpoint requires a user session
Internal server error
Stytch API call failed