Skip to Content
HomeLink Hub
Authentication

Verify an email address with the 4-digit code

POST
/api/v1/auth/verify-email-otp

Access: Public, no token needed.

Mobile counterpart of GET /auth/verify-email. Marks the account as verified when the email belongs to an unverified account and the code matches the most recently issued one and is less than 15 minutes old. Codes come from POST /auth/signup or POST /auth/resend-verification with isMobile: true. A wrong code, an expired code, an unknown email and an already-verified account all produce the same 400. No tokens are returned; sign in afterwards.

Request Body

application/json
  1. body
email*string

Email address the code was sent to.

Formatemail
code*string

The 4-digit code from the email, as a string.

Match^[0-9]{4}$

Response Body

Email verified

application/json
  1. response
status*integer
success*boolean
message*string
data*unknown
Example Request
curl -X POST 'http://localhost:4000/api/v1/auth/verify-email-otp' \  -H 'Content-Type: application/json' \  -d '{  "email": "adaeze.okonkwo@example.com",  "code": "4821"}'
Example Response
{  "status": 200,  "success": true,  "message": "Email verified successfully. You can now sign in.",  "data": null}