Skip to main content

Version: v1

Register User

Create a new user account with the provided email address and password.


HTTP Method & Endpoint

POST | /auth/register


Request

Request Body Parameters

ParameterTypeRequiredDescriptionConstraints
emailStringYesUser's email addressMust be a valid email format
passwordStringYesUser's passwordMinimum 8 characters with mix of letters, numbers and special characters

Response Format

Success Response (201 Created)

FieldTypeDescription
messageStringStatus message
dataObjectContains user-related flags or metadata
data.isVerifiedBooleanIndicates whether the user's email is verified
sourceStringSource of the response (e.g., "db")

Sample Success Response

{
"message": "Registration Success, Please verify your email before logging in",
"data": {
"isVerified": false
},
"source": "db"
}
warning

After a successful registration, you must temporarily store the user's email and password on the client side (e.g., in memory or secure storage) because these will be required—along with the OTP—for completing the email verification step.


Examples

JavaScript (React)

import axios from "axios";
import { api } from "../constant";

const registerUser = async (email,password) => {
try {
const response = await api.post("/auth/register", {
email: email
password: password
});

// temporary storage for verification purpose only
localStorage.setItem("email",email)
localStorage.setItem("password",password)

console.log("Registration successful:", response.data);
} catch (error) {
console.error("Registration failed:", error.response?.data || error.message);
}
};

Error Responses

Status CodeDescription
400Bad Request - Invalid parameters or user already exists
500Internal Server Error - Something went wrong on the server

Sample Error Response

{
"requestId": "1fb266e6-4c72-4895-bc56-88cab4308187",
"error": "BadRequestException",
"statusCode": 400,
"message": ["email must be an email"],
"path": "/auth/register",
"timestamp": 1748353186394
}