Endpoint
Request Headers
string
required
Your SuperTokens API key for authentication
string
Core Driver Interface version (e.g., “2.7”, “3.0”, “4.0”, “5.0”)
Request Body
string
required
The identifier for the third-party provider (e.g., “google”, “facebook”, “github”)
string
required
The user’s unique identifier from the third-party provider
object
required
Email information object containing:
Request Example
Response
Success Response
string
Returns
"OK" on successful authenticationboolean
true if a new user account was created, false if an existing user signed inobject
User information object containing:
string
The recipe-specific user ID for this login method (CDI 4.0+)
Success Response Example
Error Response
string
Returns
"EMAIL_CHANGE_NOT_ALLOWED_ERROR" when email cannot be changedstring
Error reason description
Error Response Example
Behavior Details
Sign Up vs Sign In
This endpoint automatically determines whether to create a new user or sign in an existing user based on:- Existing User: If a user with the same
thirdPartyIdandthirdPartyUserIdexists, the user is signed in - New User: If no matching user exists, a new user account is created
Email Verification
TheisVerified flag in the email object controls email verification:
true: The email is marked as verified (trusted provider)false: The email requires manual verification
Email verification support was added in CDI version 4.0. For earlier versions, emails are not automatically verified.
Account Linking
When account linking is enabled (CDI 4.0+), this endpoint may:- Link the social account to an existing user with the same email
- Prevent email changes if the email is already associated with another primary user
Multi-tenancy
This API is tenant-specific. The tenant is determined by:- The
tenantIdheader or query parameter - The default tenant if not specified
Version Compatibility
Common Integration Pattern
Related Endpoints
Create Session
Create a session after authentication
Get User
Retrieve user information