voice & calling
Attach a number to a SIP trunk
Routes the number's calls to the trunk: the external platform receives its inbound directly and can present it as outbound caller ID. While attached, Zernio-side voice features are off for this number (call forwarding, IVR, voicemail, recording, the softphone, and WhatsApp calling), so the number must have Calls and WhatsApp calling disabled before attaching. SMS and WhatsApp messaging are unaffected.
AuthorizationBearer <token>
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
idstring
Phone number record ID (from GET /v1/phone-numbers).
trunkIdstring
SIP trunk ID (from POST /v1/phone-numbers/sip-trunks).
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.voice.attachNumberToSipTrunk({ path: { id: 'abc123', }, body: { trunkId: 'trunk_abc123', },});console.log(data);{
"attached": true,
"phoneNumber": "string",
"trunkId": "string"
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "Unauthorized"
}Empty
Empty
Empty
Empty