Endpoint
Request Headers
Your SuperTokens API key for authentication
Core Driver Interface version (e.g., “2.7”, “3.0”, “4.0”, “5.0”)
Request Body
The identifier for the third-party provider (e.g., “google”, “facebook”, “github”)
The user’s unique identifier from the third-party provider
Email information object containing:
Request Example
Response
Success Response
Returns
"OK" on successful authenticationtrue if a new user account was created, false if an existing user signed inUser information object containing:
The recipe-specific user ID for this login method (CDI 4.0+)
Success Response Example
Error Response
Returns
"EMAIL_CHANGE_NOT_ALLOWED_ERROR" when email cannot be changedError 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
| Feature | CDI Version | Notes |
|---|---|---|
| Basic sign in/up | 2.7+ | Core functionality |
| Email verification | 4.0+ | isVerified field support |
| Account linking | 4.0+ | Automatic account linking |
| Recipe user ID | 4.0+ | Returns recipeUserId field |
| Tenant IDs | 3.0+ | Multi-tenancy support |
Common Integration Pattern
Related Endpoints
Create Session
Create a session after authentication
Get User
Retrieve user information