Skip to Content
Documentation

Email codes

Sign-in with a 6-digit code sent by email.

POST
/email-otp/send-verification-otp

Send a verification OTP to an email

Request Body

application/json
  1. body
email*string

Email address to send the OTP

type*string

Type of the OTP

Value in"email-verification""sign-in""forget-password""change-email"

Response Body

Success

application/json
  1. response
success?boolean
Example Request
curl -X POST 'https://auth.example.com/api/auth/email-otp/send-verification-otp' \  -H 'Content-Type: application/json' \  -d '{  "email": "string",  "type": "email-verification"}'
Example Response
{  "success": true}

Sign In With Email OTP

POST
/sign-in/email-otp

Sign in with email and OTP

Request Body

application/json
  1. body
email*string

Email address to sign in

otp*string

OTP sent to the email

name?string

User display name. Only used if the user is registering for the first time. Eg: "my-name"

image?string

User profile image URL. Only used if the user is registering for the first time.

[key: string]?unknown

Response Body

Success

application/json
  1. response
token*string

Session token for the authenticated session

user*
Example Request
curl -X POST 'https://auth.example.com/api/auth/sign-in/email-otp' \  -H 'Content-Type: application/json' \  -d '{  "email": "string",  "otp": "string",  "property1": null,  "property2": null}'
Example Response
{  "token": "string",  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false  }}