OTP
Managed one-time passwords via WhatsApp.
Send and verify one-time passwords (OTP) through WhatsApp. ChatVerse generates the code, sends it using your approved Authentication template, and verifies the code the user enters. Codes are single-use, expire automatically, and lock after too many wrong tries.
Copy this section as context for your AI coding agent
curl -X POST 'https://api.chatverse.io/v1/whatsapp/otp/send' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"to": "919876543210"
}'Response · 200
{
"success": true,
"data": {
"otp_id": "3f1c9a7e-…",
"to": "919876543210",
"expires_at": "2026-10-26T09:05:00+00:00",
"message_id": "wamid.HBgM…"
}
}Optional: template, language, length (4-8 digits), expiry_seconds (60-900), max_attempts (1-10). One new code per number every 30 seconds (429 RESEND_COOLDOWN) and at most 5 per 10 minutes (429 TOO_MANY_OTPS).
curl -X POST 'https://api.chatverse.io/v1/whatsapp/otp/verify' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"otp_id": "OTP_ID_FROM_SEND",
"code": "123456"
}'Response · 200
{
"success": true,
"data": {
"valid": true,
"otp_id": "3f1c9a7e-…",
"to": "919876543210"
}
}You can send to (the phone number) instead of otp_id to check the latest code. Returns valid: false with reason "INVALID_CODE", "EXPIRED", "BLOCKED", "VERIFIED", "NOT_FOUND" or "FAILED". attempts_left (remaining tries) is included with INVALID_CODE and BLOCKED.