Telephony
Phone numbers
Import DIDs (or PBX extensions) onto a SIP trunk, route inbound calls to an assistant, place outbound calls, and release numbers.
/telephony/numbers agents:readList numbers
List all phone numbers with their trunk and routed assistant.
Example request
curl https://api.bolchoai.in/v1/telephony/numbers -H "Authorization: Bearer $VOXA_API_KEY"/telephony/numbers agents:writeImport a number
Attach a DID (or non-E164 extension) from a SIP trunk and optionally route it to an assistant.
Body
| trunkId* | uuid | SIP trunk the number belongs to. |
| number* | string | E.164 number, or any string when allowNonE164 is true. |
| allowNonE164 | boolean | Disable E.164 validation (e.g. PBX extension 8200). |
| label | string | Friendly label. |
| agentId | uuid | Assistant that answers inbound calls to this number. |
Example request
curl -X POST https://api.bolchoai.in/v1/telephony/numbers -H "Authorization: Bearer $VOXA_API_KEY" -H "Content-Type: application/json" \
-d '{ "trunkId": "'$TRUNK_ID'", "number": "+14155551234", "agentId": "'$AGENT_ID'" }'/telephony/numbers/{id}/route agents:writeRoute to assistant
Set (or clear) the assistant that answers inbound calls to this number.
Path parameters
| id* | uuid | Number id. |
Body
| agentId | uuid | null | Assistant id, or null to unroute. |
Example request
curl -X POST https://api.bolchoai.in/v1/telephony/numbers/$ID/route \
-H "Authorization: Bearer $VOXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentId": "00000000-0000-0000-0000-000000000000"
}'/telephony/numbers/{id} agents:writeRelease number
Remove the number and re-sync the trunk.
Path parameters
| id* | uuid | Number id. |
Example request
curl -X DELETE https://api.bolchoai.in/v1/telephony/numbers/$ID \
-H "Authorization: Bearer $VOXA_API_KEY"/telephony/dial calls:writePlace an outbound call
Dial a destination from one of your numbers and connect the assistant the moment the callee answers. Waits for the SIP disposition and returns the call id.
Body
| fromNumberId* | uuid | The number to call from (must be on an outbound-capable trunk). |
| to* | string | Destination in E.164, e.g. +14155551234. |
| agentId | uuid | Assistant to run (defaults to the number's routed assistant). |
Example request
curl -X POST https://api.bolchoai.in/v1/telephony/dial -H "Authorization: Bearer $VOXA_API_KEY" -H "Content-Type: application/json" \
-d '{ "fromNumberId": "'$NUMBER_ID'", "to": "+14155551234", "agentId": "'$AGENT_ID'" }'Response
{ "ok": true, "status": "answered", "callId": "c1…", "to": "+14155551234" }