Send an OTP by voice call #
POST
/api/v1/otp/send
Ability: otp:send
Limit: 60 / minute per account · per-destination daily cap Idempotency-Key supported
Creates an OTP and places the call. If you omit code, a code is generated and returned in the response so your app can show or compare it. The call plays: intro → digits → repeat → digits → outro. Intro, repeat and outro are your own recordings (Panel → Voice OTP → Audio, where each file shows its id); the file must be yours, of the same type and language, and synced. If you have no file of a type, that part is skipped. If the number is busy or does not answer, we call again after 30 seconds while the code is valid (up to 3 calls); otp.failed is sent only after the last call.
| Parameter | Type | Description |
|---|---|---|
phone_number
required · body
|
string | Number to call.6–15 digits, optional leading + |
code
optional · body
|
string | Your own code. Omit to let us generate one.4–8 digits |
ttl_minutes
optional · body
|
integer | How long the code stays valid.1–30, default 10 |
language
optional · body
|
string | Language of the digits and of your intro/repeat/outro audio.bn or en, default bn |
intro_id
optional · body
|
string | Intro played before the digits. Omit to use your default intro for this language; none skips it.file id or "none" |
repeat_id
optional · body
|
string | Played between the first and second reading of the digits. Omit for your default; none skips it.file id or "none" |
outro_id
optional · body
|
string | Played after the digits. Omit for your default; none skips it.file id or "none" |
- 403Token lacks
otp:send, or plan has no Voice OTP - 422Invalid phone number, code, ttl or language; or the selected intro/repeat/outro audio is not available for this language
- 429Rate limit or daily cap for this number reached
code is present only when you did not send one.
curl -X POST "https://pbx.itfair.bd/api/v1/otp/send" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "01712345678",
"code": "4821",
"ttl_minutes": 5,
"language": "bn",
"intro_id": "12",
"repeat_id": "none",
"outro_id": "15"
}'
use Illuminate\Support\Facades\Http;
$response = Http::withToken($token)
->acceptJson()
->post('https://pbx.itfair.bd/api/v1/otp/send', [
'phone_number' => '01712345678',
'code' => '4821',
'ttl_minutes' => 5,
'language' => 'bn',
'intro_id' => '12',
'repeat_id' => 'none',
'outro_id' => '15',
]);
$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/otp/send', {
method: 'POST',
headers: {
Authorization: `Bearer ${TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"phone_number": "01712345678",
"code": "4821",
"ttl_minutes": 5,
"language": "bn",
"intro_id": "12",
"repeat_id": "none",
"outro_id": "15"
}),
});
const data = await res.json();
import requests
res = requests.post(
"https://pbx.itfair.bd/api/v1/otp/send",
headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
json={"phone_number":"01712345678","code":"4821","ttl_minutes":5,"language":"bn","intro_id":"12","repeat_id":"none","outro_id":"15"},
)
data = res.json()
Response 201
{
"status": "dispatched",
"otp_id": 1234,
"phone_number": "01712345678",
"expires_at": "2026-09-27T10:05:00+06:00",
"code": "482193"
}