Channels

Verify your customers' phone numbers with OTP

6 min readUpdated October 2026Pro · Custom
OTP verify sends a one-time password (OTP) to your customer on WhatsApp, then checks the code they type back. Use it on your own website or app for sign-ups, logins, or confirming an order. You set it up once in Tanvik, test it on screen, then connect your app with a ready-made API call.
How it works

Open Automate › OTP verify in the sidebar. The page has four sections: Send a test, Setups, Connect your app and History. The flow is always the same:

StepWhat happensSection
1. Set upYou save how codes are sent: channel, template, length, characters and expiry.Setups
2. SendTanvik makes a code and delivers it to the customer. You get back an ID for that code.Send a test / your app
3. CheckThe customer types the code. Your app sends the ID and the code to Tanvik and gets a yes or no.Send a test / your app
4. ReviewSee every code, its status and its cost, and download the list as a CSV.History
Before you begin
OTP verify is included in the Pro and Custom plans. To jump to it quickly, press Ctrl+K (Cmd+K on Mac) and search for it.
For WhatsApp codes
You need an Approved WhatsApp template in the Authentication category. Create it in Templates first (under Campaigns).
For your own app
Your app needs an API key. Workspace admins can see and manage it under Settings › Developer.
Costs
Each code has a cost. The line next to the Send code button shows it before you send, and the Cost column in History shows each code plus a total.
Sending codes by SMS is under development. The Setups form may still offer SMS, but use WhatsApp for now.
Create a setup

A setup is the saved recipe for how codes are sent. Your app names a setup each time it sends a code, so you can change the details later without changing code.

01
Open Setups
Go to the Setups section. Your saved setups are listed on the left and the New setup form is on the right.
02
Name it and choose how it is sent
Give it a clear Name, for example "Login code". Under Send by choose WhatsApp or My server sends it.
03
Pick the template
For WhatsApp, choose a Code template from your approved Authentication templates (or type its name if none is found) and set the Template language to English or Hindi.
04
Set the code rules and save
Choose Length, Expires after and Characters. Tick Use this setup when my app doesn't name one to make it your default. Click Create setup.
SettingOptions
Send byWhatsApp · My server sends it
Length4, 5, 6 or 8
Expires after1 min · 2 min · 5 min · 10 min
CharactersNumbers only · Letters and numbers
Template language (WhatsApp)English · Hindi
What does "My server sends it" mean? No message is sent. Tanvik makes the code and gives it to your server, which delivers it however you like. It is also handy for testing.

Each saved setup shows its channel, template, code rules and expiry. Click Copy ID to copy its ID, or the bin icon to delete it. Codes already sent with a deleted setup can still be checked.

Send a test code
01
Choose a Setup
In Send a test, pick your setup from the Setup list. A line under it shows the channel, template and code rules. If you have none yet, click Create a setup. Workspaces connected directly through Meta can also choose No setup: pick a template and then a Code template, Length and Expires after.
02
Enter the number
Under Send to, type the phone number with the country code, for example 91 98765 43210. Use your own number, because the code really is sent.
03
Pick who makes the code
Tanvik makes it creates and stores the code. I'll type my own lets you enter your own code, and Tanvik sends exactly that.
04
Click Send code
The card on the right shows what the customer receives. The page moves to step 2, Check the code.
05
Check the code
Type the code from your phone under Code they received and click Check code. An Expires in bar counts down. You see Code is correct, or a short message such as "This code has expired. Send a new one." and how many tries are left. Click Send a new code to start again.

At the top, Today shows how many codes were Sent, Verified, are still Waiting and Failed. Recent codes lists the latest ones with the number partly hidden.

Connect your app

The Connect your app section has everything your developer needs, with your details already filled in:

ItemWhat it is
Your API keyShown masked to workspace admins, with a Manage button. Send it on every request as Authorization: Bearer (your key). Keep it secret.
SetupPick a setup and its ID is filled into the code. Copy setup ID copies it.
Who makes the codeTanvik makes, sends and checks the code. Your server means you pass your own code when sending and Tanvik only delivers it.
1 · Send a codeCall /send-otp with config_id (the setup ID) and to (the phone number). The reply has ok: true and an otp_id to keep.
2 · Check the codeCall /verify-otp with otp_id and otp. The reply has verified: true when the code is right.
Code samplesCopy-ready snippets in cURL, Node.js, Python and PHP. Use Copy code to copy one.

When you check a code, the answer is:

CodeMeaningWhat your app should do
200The code is rightLet the person in
401Wrong codeLet them try again
410The code expiredOffer to send a new code
429Too many triesSend a new code
If a send fails with a message that your workspace needs an API key, ask a workspace admin to create one in Settings › Developer. Only admins can see the key.
History

The History section lists the codes sent from your app and from tests.

01
Choose the period and channel
Pick Today, Last 7 days or Last 30 days, and filter Sent by (All, WhatsApp, SMS or Your server).
02
Read the table
Each row shows Phone, Sent by, Status, Sent, Verified and Cost. The top of the card shows how many codes there are and the total cost.
03
Download CSV
Click Download CSV to save the list as a spreadsheet file.
StatusMeaning
WaitingSent, and the customer hasn't entered it yet
VerifiedThe customer entered the right code
FailedThe code could not be sent
ExpiredThe time ran out before the code was entered
Common problems
"Choose a code template"
A WhatsApp setup needs one of your approved Authentication templates. Check that the template is approved in Templates, then pick it again.
"Create a setup first"
Send a test needs a setup. Click Create a setup and save one.
"No API key yet"
Your workspace has no API key. A workspace admin can create one in Settings › Developer.
The customer says the code expired
Choose a longer Expires after in the setup (up to 10 min), and offer a resend button when your app gets 410.