Skip to content

Quick Start

Create an API key, activate a package with API access, and recharge your wallet. Check that your account has access to an active sender.

Examples contain a sample phone number. Replace it with a Bangladeshi mobile number you intend to call before running a request. Executing the POST request places a real call and may incur a charge.

Terminal window
export KOKILCLOUD_API_KEY='YOUR_API_KEY'

voiceId is optional. Without it, the system default OTP voice is used (initially Bangla). To choose English, add "voiceId": "1002". Both IDs are available in Dashboard → Voices → OTP voices.

Use an OTP generated by your application. Keep it as a string to preserve leading zeros. Generate a new idempotency key for each new verification attempt.

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

A successful request returns HTTP 202 Accepted:

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

Replace YOUR_CALL_ID with the value from the previous response.

Terminal window
curl 'https://api.kokilcloud.com/v1/calls/YOUR_CALL_ID' \
-H "X-API-Key: $KOKILCLOUD_API_KEY"

Check periodically, for example every 3–5 seconds, and stop when status is completed, failed, or canceled. This polling interval is an integration suggestion, not a server rate-limit guarantee.