Outbound Calls
Place, transfer, and end phone calls over the API
Outbound Calls
Dial from one of your voice-enabled numbers with createVoiceCall (POST /v1/voice/calls). On answer, the callee is bridged to the number's stored forward destination, or to a per-call forwardTo override. An optional greeting is spoken to the callee before the bridge.
Place a call
const { data } = await zernio.voice.createVoiceCall({
body: {
fromNumber: '+14155550100', // optional: which of your numbers to dial from
to: '+13105551234',
greeting: 'Connecting you now.',
}
});
console.log(data.callId, data.status); // '...', 'dialing'response = client.voice.create_voice_call(
from_number='+14155550100', # optional: which of your numbers to dial from
to='+13105551234',
greeting='Connecting you now.',
)
print(response['callId'], response['status']) # '...', 'dialing'curl -X POST "https://zernio.com/api/v1/voice/calls" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fromNumber": "+14155550100", "to": "+13105551234", "greeting": "Connecting you now."}'The 200 means the call is dialing; the lifecycle continues asynchronously. Track it with GET /v1/voice/calls/{id} or the call.* webhooks (call.received, call.ended, call.failed). Pass a per-call forwardTo (a phone, SIP, or wss:// AI agent) to bridge somewhere other than the number's default.
Outbound calls are capped per rolling hour and return a 429 when the cap is hit. Send an Idempotency-Key header to make retries safe: the same key and body replays the original response instead of dialing (and billing) a second call.
Estimate the cost first
getVoiceCallEstimate (GET /v1/voice/calls/estimate) returns the expected per-minute cost for a destination before you dial, useful for surfacing pricing or gating expensive routes.
Transfer and hang up
While a call is live, blind-transfer the callee to another destination with transferVoiceCall (POST /v1/voice/calls/{id}/transfer), or end it with endVoiceCall (POST /v1/voice/calls/{id}/end).
# Blind transfer
curl -X POST "https://zernio.com/api/v1/voice/calls/CALL_ID/transfer" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "tel:+13105559999"}'
# Hang up
curl -X POST "https://zernio.com/api/v1/voice/calls/CALL_ID/end" \
-H "Authorization: Bearer YOUR_API_KEY"Next steps
- Place calls from the browser instead of the API
- Review call history and recordings