Skip to main content
Send a numeric OTP to a customer over WhatsApp using one of your approved authentication templates.

Endpoint

Request body

string
required
Recipient’s phone number in E.164 format, e.g. +919876543210.
integer
default:"6"
Number of digits in the generated code. Accepts 4–8.
integer
default:"300"
How long the code stays valid.
string
Name of the approved authentication template to use. If omitted, Tanvik uses the most recently approved authentication-category template on your account — if you don’t have one yet, the request fails with no_default_otp_template.

Response

string
Unique identifier for this OTP request (a UUID) — pass this to the verify endpoint.
string
sent once accepted by WhatsApp.
string
ISO 8601 timestamp when the code stops being valid.
Not sure which Windows tab to use? The two aren’t interchangeable — pasting one into the wrong shell fails with a ... is not recognized error. Use CMD only in classic Command Prompt. Use PowerShell if your terminal is PowerShell, Windows Terminal, or VS Code’s integrated terminal — the default on most modern Windows setups. The PowerShell example uses Invoke-RestMethod rather than curl.exe to avoid PowerShell’s known issues passing complex quoted JSON to external executables.
Response
OTP messages use WhatsApp authentication-category templates, which have separate approval and pricing from marketing/utility templates. See Create Templates.