Skip to content

Send an OTP Call

POST/v1/otp-call

Place a call to a Bangladeshi mobile number and read a 4–8 digit OTP aloud. Choose the built-in Bangla or English OTP voice, or your own approved introduction recording. Omit voiceId to use the system default (initially Bangla). OTP requests are prioritized ahead of broadcast calls.

Header Required Description
X-API-Key Yes Your customer API key.
Content-Type Yes application/json.
Idempotency-Key Recommended A unique identifier for this logical request. Reuse it only when retrying the same request.
Field Type Required Description
phone string Yes Valid Bangladeshi mobile number. Local 01712345678 and E.164 +8801712345678 formats are accepted. Maximum 32 characters.
otp string Yes Exactly 4–8 numeric digits. Use a string, including for values like 004821.
repeatCount integer No Read the code 1–3 times. Default: 2.
voiceId string No Optional. Copy the Bangla or English OTP voice ID from Dashboard → Voices, or use your own approved recording. When omitted, the system default OTP voice is used (initially Bangla).
senderId string No An active sender available to your account. Without this field, an owned sender is selected first, with shared-sender fallback when available.

Only the documented body properties are accepted. repeatCount must be a JSON number, not a numeric string.

Dashboard → Voices → OTP voices contains two ready-to-use recordings: বাংলা OTP and English OTP. Copy either full voice ID and pass it as voiceId. The selected built-in voice determines both the introduction and the language of the OTP digits.

{ "phone": "01712345678", "otp": "004821", "voiceId": "1002" }

The built-in IDs are 1001 (Bangla) and 1002 (English). To use the default, omit voiceId entirely:

{ "phone": "01712345678", "otp": "004821" }

Bangla is the initial default. Administrators can replace either recording and select the system default in Voice Library → System OTP voices. Recording replacements keep these IDs unchanged. Your own approved recording uses the system’s configured digit language.

Replace the sample phone number before running. These examples place real calls when executed with a valid key.

Terminal window
curl -X POST 'https://api.kokilcloud.com/v1/otp-call' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: verification-example-001' \
-d '{"phone":"01712345678","otp":"482913","repeatCount":2}'

HTTP 202 Accepted — example:

{
"callId": "YOUR_CALL_ID",
"status": "queued",
"queuePosition": 1
}

Save callId and use Get Call Status to track the result. The response confirms acceptance, not successful delivery. On an idempotent replay, callId is the existing request and status can already have advanced.

Invalid input or insufficient balance returns 400. Invalid keys return 401. An inactive account, disallowed package, or unavailable sender returns 403. Conflicting use of an idempotency key can return 409. See Error Responses.