Quick Start
Before you begin
Section titled “Before you begin”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.
1. Set your API key
Section titled “1. Set your API key”export KOKILCLOUD_API_KEY='YOUR_API_KEY'2. Send the OTP
Section titled “2. Send the OTP”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.
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}3. Check the result
Section titled “3. Check the result”Replace YOUR_CALL_ID with the value from the previous response.
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.
Next steps
Section titled “Next steps”- Send an OTP Call — all request fields and language examples.
- Call Lifecycle — distinguish call status from delivery outcome.
- Idempotency & Retries — avoid duplicate calls after a network error.