Skip to Content
HomeLink Hub
Authentication

Create an account with email and password

POST
/api/v1/auth/signup

Access: Public, no token needed.

Creates an unverified account and emails a verification message (subject "Verify your HomeLink Hub account"). Web sign-ups receive a link to /auth/verify-email?token=... on the frontend that matches the role (the client app for AGENT, LANDLORD, LAWYER and DEVELOPER, the consumer site otherwise); the link token is a JWT that lives as long as an access token (JWT_ACCESS_EXPIRY, 15 minutes by default, so production should set a longer value). When isMobile is true a 4-digit code valid for 15 minutes is sent instead, to be submitted to POST /auth/verify-email-otp.

role defaults to TENANT; ADMIN cannot be chosen. LANDLORD and AGENT accounts are created with a KYC record in PENDING status. The password is stored as a bcrypt hash. The email is sent after the response and a delivery failure is only logged, so a 201 does not guarantee the email arrived: use POST /auth/resend-verification if it does not. No tokens are returned; the user must verify the email and then sign in.

Request Body

application/json
  1. body
firstName*string

Given name, 2-50 characters (trimmed).

Length2 <= length <= 50
lastName*string

Family name, 2-50 characters (trimmed).

Length2 <= length <= 50
email*string

Email address. Lower-cased and trimmed before it is stored; must be unique.

Formatemail
password*string

Password, 8-128 characters.

Length8 <= length <= 128
phone?string

Optional phone number. Digits, +, -, spaces and parentheses only.

Match^[\d+\-\s()]+$
role?string

Account type: TENANT (default), LANDLORD, AGENT, LAWYER or DEVELOPER.

Value in"TENANT""LANDLORD""AGENT""LAWYER""DEVELOPER"
isMobile?boolean

Send true from the mobile app to receive a 4-digit verification code instead of a link.

Response Body

  • Account created; verification link emailed (web)
  • Account created; 4-digit verification code emailed (isMobile: true)
application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/auth/signup' \  -H 'Content-Type: application/json' \  -d '{  "firstName": "Adaeze",  "lastName": "Okonkwo",  "email": "adaeze.okonkwo@example.com",  "password": "S3cure-Passw0rd",  "phone": "+2348031234567",  "role": "AGENT",  "isMobile": false}'
Example Response
{  "status": 201,  "success": true,  "message": "Account created successfully. Please check your email to verify your account.",  "data": {    "firstName": "Adaeze",    "lastName": "Okonkwo",    "email": "adaeze.okonkwo@example.com",    "role": "AGENT",    "isEmailVerified": false  }}