Add two-factor authentication to your SaaS without building it from scratch. Built-in OTP generation, multi-channel delivery, and verification API.
OTP generation, rate limiting, expiration logic, multi-channel delivery, verification endpoints—it's a lot of code.
You need rate limiting, brute-force protection, secure storage, and audit logs. One mistake = security breach.
SMS providers change APIs, spam filters evolve, regulations update. You have to maintain it forever.
You should be building features that make you money, not reinventing authentication infrastructure.
A complete OTP/2FA system with generation, delivery, and verification—all built-in. Just call two API endpoints.
Call one API endpoint. Sendmator generates secure OTPs and sends them via your chosen channel(s).
// Send multi-channel OTP
const response = await fetch('https://api.sendmator.com/api/v1/otp/send', {
method: 'POST',
headers: {
'X-API-Key': 'sk_live_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channels: ['email', 'sms'], // Send to multiple channels
recipients: {
email: 'user@example.com',
sms: '+1234567890'
},
sandbox_mode: true // Use true for testing
})
});
const { token } = await response.json();
// Save token for verification step
Show an input field in your app. User receives the OTP and enters it.
Your YourApp verification code:
473829
Valid for 5 minutes. Don't share this code.
Send the OTPs entered by user for verification. Get instant true/false response.
// User submits OTPs from email and SMS
const verifyResponse = await fetch('https://api.sendmator.com/api/v1/otp/verify', {
method: 'POST',
headers: {
'X-API-Key': 'sk_live_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
token: token, // from step 1
otps: {
email: '123456', // OTP from email
sms: '654321' // OTP from SMS
}
})
});
const { verified, message } = await verifyResponse.json();
if (verified) {
// Success! All OTPs matched - log user in
loginUser(user);
} else {
// Invalid or expired OTPs
showError(message || 'Invalid code. Please try again.');
}
OTPs expire after your specified time (1-30 minutes). Old codes can't be reused.
Max 1-10 verification attempts per session. Prevents brute-force attacks.
Minimum 30 second wait between resend requests. Prevents spam and abuse.
Track verification rates, failed attempts, and channel performance.
OTPs generated using cryptographically secure random number generation.
Test with fixed OTPs (123456) in development without sending real messages.
Let users log in with just their phone number or email—no password needed.
Add 2FA to existing password login for extra security on sensitive accounts.
Verify user phone numbers during signup or profile updates to prevent fake accounts.
Require OTP before processing high-value transactions or withdrawals.
Send OTP to verify identity before allowing password reset—prevents account takeovers.
Require re-verification for account deletion, API key generation, or settings changes.
Per verification
Per verification (US)
Per verification
Example: 1,000 SMS verifications/month
vs building & maintaining your own system
See why teams are switching from other OTP services
Stop building auth infrastructure. Start building your product.
100 free emails • Sandbox mode for testing • No credit card required