GUIDE Developer docs

WhatsApp OTP API documentation

Everything you need to send and verify WhatsApp OTPs from your own WhatsApp Business number: authentication, endpoints, errors, limits and examples.

✓ Official WhatsApp Business API✓ Free plan✓ Hindi & English support
Quick answer

To verify a user with the AutoChatly WhatsApp OTP API, call POST https://app.autochatly.com/api/verify/v1/send with the phone number and your API key as a Bearer token, store the returned request_id, then call POST /api/verify/v1/check with the request_id and the 6-digit code the user entered. A response with verified: true means the number is confirmed.

Updated 23 Oct 2026 · AutoChatly team
How it works

Live in 3 simple steps.

Connect WhatsApp and get the template approved

In the AutoChatly dashboard open WhatsApp OTP, connect your number and click Create OTP template.

Create an API key

Name the key, optionally lock it to your server IPs, and copy it once. Store it as an environment variable.

Call send, then check

Send the code when the user enters their number; check it when they type the code.

Base URL and authentication

Base URL: https://app.autochatly.com/api/verify/v1. Send your API key in the header Authorization: Bearer acv_live_... and use Content-Type: application/json. Call the API only from your server; never put the key in a website, mobile app or public repository. Machine-readable spec: OpenAPI 3 JSON.

POST /send

Sends a 6-digit code to the user on WhatsApp from your connected WhatsApp Business number.

FieldTypeDescription
phonestring, requiredInternational format, e.g. +919876543210. A 10-digit Indian mobile is treated as +91.
curl -X POST https://app.autochatly.com/api/verify/v1/send \
  -H "Authorization: Bearer $AUTOCHATLY_OTP_KEY" -H "Content-Type: application/json" \
  -d '{"phone":"+919876543210"}'

{"ok":true,"request_id":"6f1c2b7e-3a9d-4c1e-9b8a-2f4d5e6a7b8c","expires_in":300,"channel":"whatsapp"}

Store request_id with the user's session. The code itself is never returned to you.

POST /check

FieldTypeDescription
request_iduuid, requiredValue returned by /send.
codestring, requiredThe 6 digits the user typed.
curl -X POST https://app.autochatly.com/api/verify/v1/check \
  -H "Authorization: Bearer $AUTOCHATLY_OTP_KEY" -H "Content-Type: application/json" \
  -d '{"request_id":"6f1c2b7e-3a9d-4c1e-9b8a-2f4d5e6a7b8c","code":"123456"}'

{"ok":true,"verified":true,"phone":"+919876543210"}

Only trust "verified": true from this call. Then log the user in or mark the number as verified.

Errors

Every error returns {"ok": false, "error": "code", "message": "..."}. The message is written for end users and safe to display.

HTTPerrorMeaning
401unauthorizedMissing, wrong, revoked or IP-restricted key.
422invalid_phone / wrong_codeBad number format, or wrong code (attempts_left included).
422country_not_allowedCountry not enabled (India +91 by default).
429too_soon / phone_limit / ip_limit / app_limit / too_many_requestsRate limit reached. Retry later.
404not_foundUnknown request_id for this key.
409already_usedCode was already verified.
410expired / blockedCode expired, or locked after 5 wrong attempts. Send a new one.
502send_failedWhatsApp could not deliver (e.g. number not on WhatsApp). Fall back to SMS or email.
503not_configuredYour WhatsApp number is not connected.

Limits

  • Code: 6 digits, valid 5 minutes, single use, 5 attempts.
  • Per phone number (per business): one code every 30 seconds, 3 per 10 minutes, 10 per day.
  • Per API key: 30 sends per minute and 5,000 per day by default (ask support to raise).
  • Per IP: 120 requests per minute; repeated invalid keys lock the IP for 10 minutes.

Security

  • Codes are generated with a cryptographically secure random generator and stored only as an HMAC hash. They never appear in logs or API responses.
  • API keys are stored hashed, shown once, can be locked to server IPs and revoked instantly.
  • Request IDs are random UUIDs and only work with the key that created them.
  • A country allow-list blocks OTP-pumping fraud. All traffic is HTTPS.
  • End-user phone numbers are used only to deliver and verify codes for your business.

Best practices

  • Keep the key in an environment variable on your server.
  • Rate-limit your own "send code" button per user and add a CAPTCHA on public signup forms.
  • Show the message from error responses to users; it is already friendly.
  • Offer SMS or email as a fallback when you get send_failed.
FAQ

Questions, answered.

Can I call the OTP API from JavaScript in the browser?

No. The API key must stay secret, so call the API from your backend (Laravel, Node.js, Python, PHP, Java, etc.) and let your website or app talk to your backend.

Is there a sandbox?

Use the Send test OTP box on the WhatsApp OTP page in your dashboard to send real codes to your own phone before integrating.

Which WhatsApp number sends the code?

Your own WhatsApp Business number connected in AutoChatly, using an authentication template on your account.

Start growing on WhatsApp today.

Create your free account in 30 seconds. No credit card needed.

Log in Start free