Skip to main content

POST /api/register/init

Initiates user registration by sending a 6-digit OTP to the provided email address. The OTP expires in 10 minutes.

Request Body

fullname
string
required
User’s full name
email
string
required
Valid email address (will be normalized)Validation: Must be a valid email format
password
string
required
User passwordValidation Rules:
  • Minimum 8 characters
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number
  • At least one special character (@$!%*?&)
Pattern: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

Response

message
string
Success or error message

Status Codes

  • 200 - OTP sent successfully
  • 400 - Validation error (invalid email format, weak password, etc.)
  • 409 - Account already exists with this email OR user already initiated registration (pending OTP verification)
  • 500 - Failed to send OTP

Example Request

curl -X POST https://api.deployhub.cloud/api/register/init \
  -H "Content-Type: application/json" \
  -d '{
    "fullname": "John Doe",
    "email": "john@example.com",
    "password": "SecurePass123!"
  }'

Example Response

{
  "message": "Otp Sent Success"
}

Error Responses

{
  "message": "Password must be at least 8 characters and include uppercase, lowercase, number, and special character"
}

POST /api/register/verify

Completes user registration by verifying the OTP sent to the email address. Creates the user account and subscription upon successful verification.

Request Body

email
string
required
Email address used during registration initializationValidation: Must be a valid email format
otp
string
required
6-digit numeric OTP code received via emailValidation:
  • Must be exactly 6 characters
  • Must be numeric only

Response

message
string
Success or error message

Status Codes

  • 201 - User registered successfully
  • 400 - Validation error or invalid/expired OTP
  • 404 - Registration not initiated for this email
  • 500 - Internal server error

Example Request

curl -X POST https://api.deployhub.cloud/api/register/verify \
  -H "Content-Type: application/json" \
  -d '{
    "email": "john@example.com",
    "otp": "123456"
  }'

Example Response

{
  "message": "User register Success"
}

Error Responses

{
  "message": "Invalid Otp Or Expired"
}

Notes

  • OTP codes expire after 10 minutes
  • After successful verification, a welcome email is queued for delivery
  • A subscription record is automatically created for the new user
  • Temporary user data is removed after successful verification