Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin.
Sign in with a social provider
Request Body
callbackURLCallback URL to redirect to after the user has signed in
newUserCallbackURLerrorCallbackURLCallback URL to redirect to if an error happens
disableRedirectDisable automatic redirection to the provider. Useful for handling the redirection yourself
scopesArray of scopes to request from the provider. This will override the default scopes passed.
requestSignUpExplicitly request sign-up. Useful when disableImplicitSignUp is true for this provider
loginHintThe login hint to use for the authorization code request
Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).
Responses
Success - Returns session details (idToken branch) or an authorize URL (redirect branch)
redirectSign out the current user
Request Body optional
callbackURLThe URL to redirect to after provider logout
disableRedirectReturn the provider logout URL without redirecting
stateState to pass to the provider logout endpoint
Responses
Success
successurlProvider logout URL when RP-initiated logout is available
redirectWhether the client should redirect to the provider logout URL
Sign up a user using email and password
Request Body
nameThe name of the user
emailThe email of the user
passwordThe password of the user
imageThe profile image URL of the user
callbackURLThe URL to use for email verification callback
rememberMeIf this is false, the session will not be remembered. Default is true.
Responses
Successfully created user
tokenAuthentication token for the session
Sign in with email and password
Request Body
emailEmail of the user
passwordPassword of the user
callbackURLCallback URL to use as a redirect for email verification
rememberMeIf this is false, the session will not be remembered. Default is true.
Responses
Success - Returns either session details or redirect URL
urlVerify the email of the user
query Parameters
tokenThe token to verify the email
callbackURLThe URL to redirect to after email verification
Responses
Success
statusIndicates if the email was verified successfully
Request Body
newEmailThe new email address to set must be a valid email address
callbackURLThe URL to redirect to after email verification
Responses
Email change request processed successfully
statusIndicates if the request was successful
messageStatus message of the email change process
Change the password of the user
Request Body
newPasswordThe new password to set
currentPasswordThe current password is required
revokeOtherSessionsMust be a boolean value
Responses
Password successfully changed
tokenNew session token if other sessions were revoked
Delete the user
Request Body
callbackURLThe callback URL to redirect to after the user is deleted
passwordThe user's password. Required if session is not fresh
tokenThe deletion verification token
Responses
User deletion processed successfully
successIndicates if the operation was successful
messageStatus message of the deletion process
Send a password reset email to the user
Request Body
emailThe email address of the user to send a password reset email to
redirectToThe URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter ?error=INVALID_TOKEN. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN
Responses
Success
statusmessageLink a social account to the user
Request Body
callbackURLThe URL to redirect to after the user has signed in
requestSignUpscopesAdditional scopes to request from the provider
errorCallbackURLThe URL to redirect to if there is an error during the link process
disableRedirectDisable automatic redirection to the provider. Useful for handling the redirection yourself
loginHintThe login hint to use for the authorization code request
Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).
Responses
Success
redirectIndicates if the user should be redirected to the authorization URL
urlThe authorization URL to redirect the user to
statusCallback to complete user deletion with verification token
query Parameters
tokenThe token to verify the deletion request
callbackURLThe URL to redirect to after deletion
Responses
User successfully deleted
successIndicates if the deletion was successful
messageConfirmation message
Refresh the access token using a refresh token
Request Body
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: accountId | |
| type = object · requires: useAccountCookie |
accountIdThe Better Auth account ID
userIdThe user ID associated with the account
Responses
Access token refreshed successfully
tokenTypeidTokenaccessTokenrefreshTokenaccessTokenExpiresAtrefreshTokenExpiresAtGet a valid access token, doing a refresh if needed
Request Body
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: accountId | |
| type = object · requires: useAccountCookie |
accountIdThe Better Auth account ID
userIdThe user ID associated with the account
Responses
A Valid access token
tokenTypeidTokenaccessTokenaccessTokenExpiresAt