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.
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"