Universal Email & OTP Delivery Service
The service autonomously generates, delivers, resends, and verifies OTP codes. No custom OTP passing required. Setup your Gmail App Password to generate your private Secret Key, and call the minimal APIs.
x-api-key
Register Your Email Credentials
Switch to Configure & Keys and provide your support email and 16-character Google App Password. The service verifies the connection and gives you a private sec_live_... Secret Key.
Call Send OTP API from Your Backend
When a user signs up or requests a password reset, your backend sends a POST request to /api/otp/send with { "email": "user@example.com" } and header x-api-key: YOUR_KEY.
The service autonomously generates a 6-digit numeric OTP and emails it directly. The OTP is never returned in the API response to prevent frontend leaks.
Verify User's Entered OTP
When the user enters the 6 digits on your website, your backend calls /api/otp/verify with { "email": "user@example.com", "otp": "123456" }.
The service validates the code, tracks attempts (max 5), and returns verified status.
Register Email & Generate Secret Key
Did you purchase or integrate this service? Configure your support email and Google App Password below to generate your private API Secret Key.
x-api-key
.env).
Need help setting up Gmail App Password?
Follow our 60-second visual guide to generate a free 16-character Google App Password.
API Playground & Testing Console
Execute real API calls to generate OTPs, test anti-spam cooldown on resend, verify codes, and dispatch transactional emails.
API Documentation & Situation Guides
Understand what payload is required in each scenario. Authenticate every call by providing your Secret Key in the x-api-key header.
Situation 1 User Signup & Account Verification
When a new customer signs up, verify their email address before activating their account:
- Your backend receives signup details -> Calls
POST /api/otp/sendwith{ "email": userEmail, "name": userName, "type": "verification" }. - User receives an email with a 6-digit OTP code (valid for 10 minutes).
- User inputs the 6 digits on your website -> Frontend sends it to your backend -> Calls
POST /api/otp/verifywith{ "email": userEmail, "otp": code }. - If
verified: true, setisEmailVerified = truein your database!
Situation 2 Forgot Password & Password Reset
When a customer forgets their password and requests a reset code:
- Customer clicks "Forgot Password" -> Your backend calls
POST /api/otp/sendwith{ "email": userEmail, "type": "forgot_password" }. - Customer receives a branded Password Reset security email with the 6-digit code.
- Customer submits the code with their new password -> Call
POST /api/otp/verify. If valid, update their password hash.
Situation 3 Two-Factor Authentication (2FA) / Login OTP
Protect customer logins with an extra verification code:
- Customer enters username & password -> Password matches -> Call
POST /api/otp/sendwith{ "email": userEmail, "type": "login" }. - Show prompt: "Enter the 6-digit security code sent to your email".
- Customer submits code -> Call
POST /api/otp/verify. If valid, issue JWT / auth session.
Situation 4 Resend OTP with Anti-Spam Protection
When a user hasn't received the code and clicks "Resend OTP":
- Customer clicks "Resend Code" -> Your backend calls
POST /api/otp/resendwith{ "email": userEmail }. - If requested within 60s of previous attempt, service returns
429 COOLDOWN_ACTIVEwith remaining seconds. - If cooldown has passed, service generates a fresh 6-digit OTP and invalidates the previous code.
Situation 5 Transactional & Alert Emails
Send order confirmations, invoices, or critical system notifications:
- Your backend calls
POST /api/email/sendwith{ "to": userEmail, "subject": "Order Confirmed", "html": ".Thank you!
" } - Email is instantly dispatched via your configured SMTP / Gmail sender.
Generates a fresh 6-digit OTP internally and dispatches it directly to the recipient's email address.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Recipient email address |
name | string | No | Recipient's name (defaults to "User") |
type | string | No | verification, forgot_password, or login |
expiresInMinutes | number | No | OTP expiry duration (defaults to 10 minutes) |
curl -X POST "https://mail.watsalead.in/api/otp/send" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_SECRET_KEY" \
-d '{
"email": "customer@example.com",
"name": "Sarah",
"type": "verification"
}'
Generates a new OTP, invalidates previous ones, and delivers it. Automatically enforces a 60-second cooldown.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Recipient email address |
curl -X POST "https://mail.watsalead.in/api/otp/resend" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_SECRET_KEY" \
-d '{
"email": "customer@example.com"
}'
Verifies the OTP code submitted by the user. Decrements attempts on failure (max 5 attempts).
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Recipient email address |
otp | string | Yes | The 6-digit OTP code received in email |
curl -X POST "https://mail.watsalead.in/api/otp/verify" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_SECRET_KEY" \
-d '{
"email": "customer@example.com",
"otp": "123456"
}'
Sends custom HTML or text transactional emails (e.g. Invoices, Welcome letters, System alerts).
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address |
subject | string | Yes | Email Subject line |
html | string | Yes* | HTML body content (or plain text) |
text | string | No | Plain text fallback |
curl -X POST "https://mail.watsalead.in/api/email/send" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_SECRET_KEY" \
-d '{
"to": "customer@example.com",
"subject": "Order Confirmation #8921",
"html": "<h1>Thank you for your order!</h1><p>Your package is on its way.</p>"
}'
How to Get a Free Google App Password
Google requires an App Password rather than your standard Gmail account password to send automated emails via SMTP. Follow these 4 simple steps to generate one for free.
Turn On 2-Step Verification
Visit your Google Account Security dashboard at myaccount.google.com/security. Look for the "How you sign in to Google" section and ensure 2-Step Verification is switched ON. If it's already ON, you can proceed directly to Step 2.
Open Google App Passwords
Open the dedicated App Passwords page directly at:
https://myaccount.google.com/apppasswords
(Alternatively, you can type "App passwords" in the search box at the top of your Google Account page).
Create Your App Name
In the text box labeled "App name", enter an identifier such as:
Leadify Email Service
Then click the yellow/blue "Create" button.
Copy the 16-Character Code
Google will show a modal window with a yellow highlighted 16-character code (e.g. abcd efgh ijkl mnop).
Copy this 16-character code, go to our Configure & Keys page, and paste it into the Gmail App Password field.
Sign In to Your Account
Access your private API keys, email logs, and SMTP configuration.
Create Developer Account
Get your private Secret API Key and start sending emails & OTPs in 60 seconds.
Developer Dashboard
Manage your email service configuration, dedicated Secret Key, and live endpoints.
x-api-key: YOUR_KEY