Back to Docs

Verify API

Multi-channel verification (SMS, WhatsApp, Voice, Email)

Verification Channels

SMS

Text message OTP

WhatsApp

WhatsApp message

Voice

Voice call OTP

Email

Email verification

Dual-Key Authentication

API KeyPermanent

X-Smsly-Key-Id: sk_live_xxx

SDK KeyRotatable

X-SMSLY-SDK-KEY: sdk_live_xxx

Quick Start

Python
from smsly import SMSly

# === DUAL KEY SECURITY ===
# Two keys required (both can be in .env or embedded):
# 1. API Key - for authentication
# 2. SDK Key - for SDK validation

client = SMSly(
    api_key="setup_api_your_key",   # From dashboard
    sdk_key="setup_sdk_your_key"    # From dashboard
)

# Start verification (auto-selects best channel)
verification = client.verify.start(
    to="+1234567890",
    channel="sms"  # or "whatsapp", "voice", "email"
)
print(f"Verification ID: {verification.id}")

# Check the code user entered
result = client.verify.check(
    to="+1234567890",
    code="123456"
)

if result.valid:
    print("✓ Phone number verified!")
else:
    print("✗ Invalid code, attempts remaining:", result.attempts_remaining)

# === METHOD 2: Environment Variables ===
# SMSLY_API_KEY=setup_api_xxx
# SMSLY_SDK_KEY=setup_sdk_xxx
client = SMSly()  # Auto-reads from env

API Endpoints

POST/v1/verify/startStart verification
POST/v1/verify/checkCheck verification code
POST/v1/verify/cancelCancel verification
GET/v1/verify/:idGet verification status

Ready to verify users?

Get API Keys