Setup
Enable phone calling on a number and configure how inbound calls are handled
Setup
A number you buy comes with PSTN calling on, so "setup" here is really about inbound routing: where an incoming call goes, plus voicemail, hours, and menus. It is one endpoint: enableVoiceOnNumber (POST /v1/phone-numbers/{id}/voice).
Configuring voice on a number requires usage-based billing to be active (the Usage plan).
Set the forward destination
Inbound calls route to forwardTo, which accepts three destination types:
tel:+E164- a regular phone numbersip:...- a SIP endpointwss://...- a WebSocket media server, which is how you bridge to an AI voice agent (Vapi, Retell, or your own)
const { data } = await zernio.voice.enableVoiceOnNumber({
path: { id: 'PHONE_NUMBER_ID' },
body: {
forwardTo: 'tel:+13105551234',
recordingEnabled: false,
transcriptionEnabled: false,
}
});
console.log('Voice enabled:', data.enabled);response = client.voice.enable_voice_on_number(
id='PHONE_NUMBER_ID',
forward_to='tel:+13105551234',
recording_enabled=False,
transcription_enabled=False,
)
print('Voice enabled:', response['enabled'])curl -X POST "https://zernio.com/api/v1/phone-numbers/PHONE_NUMBER_ID/voice" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"forwardTo": "tel:+13105551234", "recordingEnabled": false, "transcriptionEnabled": false}'Because the endpoint is idempotent and only writes fields you send, it is also how you update settings later. Omitting forwardTo preserves the current destination; sending an empty string clears it. A number can be voice-enabled with no forward at all (outbound-only).
Optional inbound features
Pass any of these alongside forwardTo to shape how inbound calls behave:
| Feature | What it does |
|---|---|
| Voicemail | Take a message when the call is not answered |
| Business hours | Only forward during configured windows; otherwise voicemail or a message |
| IVR menu | Play a menu and route by keypress |
| Caller blocklist | Reject calls from specific numbers |
| Recording | Record calls (off by default, consent prompt plays, small per-minute surcharge) |
| Transcription | Produce a text transcript of the call |
See enable voice on a number for each feature's exact field names and shapes.
How the features interact
The features aren't independent switches — an inbound call walks through them in a fixed order:
- Blocklisted callers get a busy signal. The call is rejected before it's answered — no charge, no voicemail, and no webhook fires for it.
- Business hours gate everything live. Outside the configured windows the call skips the menu and the forward entirely and goes to voicemail. With voicemail disabled too, it simply hangs up.
- The IVR menu supersedes the plain forward. When a menu with options is enabled, the caller hears it instead of ringing
forwardTodirectly; the pressed digit picks that option's destination. No or invalid input ends the call. - Voicemail is the fallback for every non-answer. Unanswered forwards (about 25 seconds of ringing), failed bridges, and after-hours calls all land there: the greeting (yours, or a default) plays, a beep follows, and up to two minutes are recorded. You get an email, and the recording and transcript (when transcription is on) land on the call record — there is no separate voicemail webhook.
- Recording never starts silently. On bridged calls a consent notice plays first; the recording lands on the call record shortly after hangup, not on the
call.endedpayload. - Webhooks:
call.receivedfires as the call enters the pipeline (after the blocklist check, before any menu or ring), and every answered path ends withcall.ended.
Turn voice off
Disable calling on a number with disableVoiceOnNumber (DELETE /v1/phone-numbers/{id}/voice). Settings are preserved so you can re-enable without reconfiguring.
curl -X DELETE "https://zernio.com/api/v1/phone-numbers/PHONE_NUMBER_ID/voice" \
-H "Authorization: Bearer YOUR_API_KEY"