Manage & View
100 min
apis for viewing configurations, updating settings, and managing your trunk get phone numbers retrieves all phone numbers mapped to a trunk http request get https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers example request curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers" example response { "request id" "785471d288054cbf8c677b75e0b5f2f8", "method" "get", "http code" 200, "metadata" { "page size" 50, "first page uri" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/phone numbers?offset=0\&page size=50", "prev page uri" null, "next page uri" null }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "id" "41523", "phone number" "+918040264208", "trunk sid" "trmum1f708622631150902801a1n", "date created" "2026 01 23t13 28 11z", "date updated" "2026 01 23t13 41 59z", "mode" "flow" } } ] } response parameters parameter name type & value metadata page size integer; number of results per page metadata first page uri string; uri for the first page metadata prev page uri string or null; uri for previous page (null if on first page) metadata next page uri string or null; uri for next page (null if on last page) response\[] array; list of phone number objects get acls (whitelisted ips) retrieves all whitelisted ip addresses for a trunk http request get https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/whitelisted ips example request curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/whitelisted ips" example response { "request id" "91dc982ca79846479c6f9678c788cfc1", "method" "get", "http code" 200, "metadata" { "page size" 50, "first page uri" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/whitelisted ips?offset=0\&page size=50", "prev page uri" null, "next page uri" null }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "id" "1154", "mask" 32, "trunk sid" "trmum1f708622631150902801a1n", "ip" "44 248 146 11", "friendly name" null, "date created" "2026 01 23t13 30 04z", "date updated" "2026 01 23t13 30 04z" } } ] } get destination uris retrieves all destination uris configured for a trunk http request get https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris example request curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris" example response { "request id" "bfc1544ab0ab4df3ae49173ccc744331", "method" "get", "http code" 200, "metadata" { "page size" 50, "first page uri" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/destination uris?offset=0\&page size=50", "prev page uri" null, "next page uri" null }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "id" "2544", "destination" "sip\ sip company com 5061;transport=tls", "date created" "2026 01 23t13 39 06z", "date updated" "2026 01 23t13 39 06z", "type" "public", "priority" 0, "weight" 1, "trunk sid" "trmum1f708622631150902801a1n" } }, { "code" 200, "error data" null, "status" "success", "data" { "id" "2543", "destination" "sip 44 248 146 11 5061;transport=tls", "date created" "2026 01 23t13 38 32z", "date updated" "2026 01 23t13 38 32z", "type" "public", "priority" 0, "weight" 1, "trunk sid" "trmum1f708622631150902801a1n" } } ] } update phone number mode updates the routing mode for a mapped phone number use this to switch between pstn and streamkit (voice ai) modes http request put https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers/\<phone number id> important the \<phone number id>is the numeric id returned when you mapped the phone number (e g , 41523), not the phone number itself request headers header value content type application/json request parameters parameter name mandatory/optional value phone number mandatory string; the phone number in e 164 format must match the phone number associated with the id example +919876543210 mode mandatory string; the new routing mode can be pstn route calls to telephone network, flow route calls to voice ai bot (streamkit) example request (switch to flow mode) curl s x put "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers/41523" \\ h "content type application/json" \\ d '{ "phone number" "+918040264208", "mode" "flow" }' example request (switch to pstn mode) curl s x put "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers/41523" \\ h "content type application/json" \\ d '{ "phone number" "+918040264208", "mode" "pstn" }' example response { "request id" "c719cd56eb5943e789e1bdbd4ce1515a", "method" "put", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "41523", "phone number" "+918040264208", "trunk sid" "trmum1f708622631150902801a1n", "date created" "2026 01 23t13 28 11z", "date updated" "2026 01 23t13 41 59z", "mode" "flow" } } } response parameters parameter name type & value id string; the phone number mapping id phone number string; the phone number in e 164 format trunk sid string; the associated trunk mode string; the updated routing mode (pstn or flow) date created string; iso 8601 timestamp when mapping was created date updated string; iso 8601 timestamp when mapping was updated (will be updated after this call) set trunk alias (caller id) sets the phone number displayed to called parties on outbound calls this is useful when you want to display a specific caller id regardless of which phone number is mapped to the trunk http request post https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/settings request headers header value content type application/json request parameters parameter name mandatory/optional value settings mandatory array; list of setting objects settings\[] name mandatory string; setting name use trunk external aliasfor caller id settings\[] value mandatory string; the phone number to display as caller id should be in e 164 format example +919876543210 example request curl s x post "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/settings" \\ h "content type application/json" \\ d '{ "settings" \[ { "name" "trunk external alias", "value" "+919876543210" } ] }' example response { "request id" "8ce98845365f43fd97c2f46df38438c6", "method" "post", "http code" 200, "metadata" { "total" 1, "success" 1 }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "name" "trunk external alias", "value" "+919876543210", "trunk sid" "trmum1f708622631150902801a1n", "date created" "2026 01 23t13 34 50z", "date updated" "2026 01 23t13 34 50z" } } ] } response parameters parameter name type & value metadata total integer; total number of settings in request metadata success integer; number of successfully applied settings name string; setting name (trunk external alias) value string; the caller id phone number trunk sid string; the associated trunk date created string; iso 8601 timestamp when setting was created date updated string; iso 8601 timestamp when setting was last updated delete trunk permanently deletes a trunk and all its associated configurations (phone numbers, acls, destination uris) ⚠️ warning this action cannot be undone all associated phone number mappings, whitelisted ips, and destination uris will be permanently deleted http request delete https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks?trunk sid=\<trunk sid> example request curl s x delete "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks?trunk sid=\<trunk sid>" example response { "request id" "f708818c79f547b3aee31c4a480367a5", "method" "delete", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "trunk name" "my trunk1234", "date created" "2026 01 23t13 25 39z", "date updated" "2026 01 23t13 25 39z", "trunk sid" "trmum15f77c83605998cdb9d1a1n", "status" "active", "domain name" "ameyo5m pstn exotel com", "auth type" "ip whitelist", "registration enabled" "disabled", "edge preference" "auto", "nso code" "any any", "secure trunking" "disabled", "destination uris" "/v2/accounts/ameyo5m/trunks/trmum15f77c83605998cdb9d1a1n/destination uris", "whitelisted ips" "/v2/accounts/ameyo5m/trunks/trmum15f77c83605998cdb9d1a1n/whitelisted ips", "credentials" "/v2/accounts/ameyo5m/trunks/trmum15f77c83605998cdb9d1a1n/credentials", "phone numbers" "/v2/accounts/ameyo5m/trunks/trmum15f77c83605998cdb9d1a1n/phone numbers" } } } response parameters the response returns the full trunk data that was deleted, allowing you to verify which trunk was removed list trunks retrieves all sip trunks for the account with pagination optionally filter to a single trunk using trunk sid http request get https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks request headers header value content type application/json query parameters parameter name mandatory/optional value page size optional integer; number of results per page default 50 offset optional integer; pagination offset default 0 trunk sid optional string; when provided, returns only the matching trunk example request \ blockquote curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks?page size=50\&offset=0" example request (single trunk filter) curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks?trunk sid=\<trunk sid>" http response on success, the http response status code will be 200 ok example response { "request id" "785471d288054cbf8c677b75e0b5f2f8", "method" "get", "http code" 200, "metadata" { "page size" 50, "first page uri" "/v2/accounts/\<your sid>/trunks?offset=0\&page size=50", "prev page uri" null, "next page uri" null }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "trunk name" "outbound trunk", "date created" "2026 01 23t09 24 59z", "date updated" "2026 01 23t09 24 59z", "trunk sid" "trmum1f708622631150902801a1n", "status" "active", "domain name" "ameyo5m pstn exotel com", "auth type" "ip whitelist", "registration enabled" "disabled", "edge preference" "auto", "nso code" "any any", "secure trunking" "disabled", "destination uris" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/destination uris", "whitelisted ips" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/whitelisted ips", "credentials" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/credentials", "phone numbers" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/phone numbers" } } ] } response parameters parameter name type & value metadata page size integer; number of results per page metadata first page uri string; uri for the first page metadata prev page uri string or null; uri for previous page metadata next page uri string or null; uri for next page response\[] array; list of trunk objects (same fields as create trunk response) update trunk partially updates trunk properties such as trunk name, auth type, or nso code http request put https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid> request headers header value content type application/json request parameters parameter name mandatory/optional value trunk name optional string; unique identifier for the trunk must be alphanumeric with underscores only, maximum 16 characters auth type optional string; authentication type (e g ip whitelist) nso code optional string; network service operator code use any any for standard configuration example request curl s x put "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>" \ h "content type application/json" \ d '{ "trunk name" "my pbx trunk" }' http response on success, the http response status code will be 200 ok example response { "request id" "c719cd56eb5943e789e1bdbd4ce1515a", "method" "put", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "trunk name" "my pbx trunk", "date created" "2026 01 23t09 24 59z", "date updated" "2026 01 23t14 10 12z", "trunk sid" "trmum1f708622631150902801a1n", "status" "active", "domain name" "\<accounsid> pstn exotel com", "auth type" "ip whitelist", "registration enabled" "disabled", "edge preference" "auto", "nso code" "any any", "secure trunking" "disabled", "destination uris" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/destination uris", "whitelisted ips" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/whitelisted ips", "credentials" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/credentials", "phone numbers" "/v2/accounts/ameyo5m/trunks/trmum1f708622631150902801a1n/phone numbers" } } } response parameters parameter name type & value trunk sid string; unique identifier for the trunk trunk name string; updated trunk name date updated string; iso 8601 timestamp when trunk was last updated status string; current trunk status (active / inactive) trunk map lookup (exophone) resolves which trunk a virtual number (exophone / did) is mapped to http request get https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunk maps request headers header value content type application/json query parameters parameter name mandatory/optional value exophone mandatory string; virtual number / did in e 164 format example +919876543210 trunk sid optional string; optionally constrain lookup to a specific trunk example request curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunk maps?exophone=+919876543210" http response on success, the http response status code will be 200 ok example response { "request id" "13ab9319cf574486ba299c364f82cade", "method" "get", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "exophone" "+919876543210", "trunk sid" "trmum1f708622631150902801a1n", "phone number id" "41512", "mode" "pstn" } } } response parameters parameter name type & value exophone string; the queried virtual number in e 164 format trunk sid string; trunk sid associated with this number phone number id string; numeric mapping id (same id used by update phone number mode / delete phone number mapping) mode string or null; routing mode (pstn / flow / null) delete phone number mapping detaches a phone number (did/exophone) from the trunk important pass the numeric mapping id returned when you mapped the phone number (e g 41523), not the phone number itself the id is passed as query parameter id http request delete https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers?id=\<phone number id> example request curl s x delete "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/phone numbers?id=41523" http response on success, the http response status code will be 200 ok example response { "request id" "c719cd56eb5943e789e1bdbd4ce1515a", "method" "delete", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "41523", "phone number" "+918040264208", "trunk sid" "trmum1f708622631150902801a1n", "date created" "2026 01 23t13 28 11z", "date updated" "2026 01 23t13 41 59z", "mode" "flow" } } } response parameters parameter name type & value id string; deleted phone number mapping id phone number string; the detached phone number in e 164 format trunk sid string; the trunk this mapping belonged to mode string or null; routing mode at time of delete update whitelisted ip updates an existing acl (whitelisted ip) entry — for example to change ip or subnet mask important \\\<whitelist\\ entry\\ id> is the numeric id returned when you mapped the acl (e g 1153), not the ip address itself http request put https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/whitelisted ips/\<whitelist entry id> request headers header value content type application/json request parameters parameter name mandatory/optional value ip mandatory string; ipv4 address example 44 248 146 11 mask mandatory integer; subnet mask in cidr notation example 32, 24 example request curl s x put "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/whitelisted ips/1153" \ h "content type application/json" \ d '{ "ip" "44 248 146 11", "mask" 32 }' http response on success, the http response status code will be 200 ok example response { "request id" "3daaed4cd05d443f854e07e60dd4c008", "method" "put", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "1153", "mask" 32, "trunk sid" "trmum1f708622631150902801a1n", "ip" "44 248 146 11", "friendly name" null, "date created" "2026 01 23t11 37 36z", "date updated" "2026 01 23t15 02 10z" } } } response parameters parameter name type & value id string; unique identifier for this acl entry ip string; the whitelisted ip address mask integer; subnet mask in cidr notation trunk sid string; the trunk this acl is associated with date updated string; iso 8601 timestamp when acl was last updated delete whitelisted ip removes an acl (whitelisted ip) entry from the trunk important whitelist entry id is passed as query param id (not /whitelisted ips/\\\<id>) http request delete https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/whitelisted ips?id=\<whitelist entry id> example request curl s x delete "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/whitelisted ips?id=1153" http response on success, the http response status code will be 200 ok example response { "request id" "91dc982ca79846479c6f9678c788cfc1", "method" "delete", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "1153", "mask" 32, "trunk sid" "trmum1f708622631150902801a1n", "ip" "44 248 146 11", "friendly name" null, "date created" "2026 01 23t11 37 36z", "date updated" "2026 01 23t11 37 36z" } } } response parameters parameter name type & value id string; deleted acl entry id ip string; the ip that was removed mask integer; subnet mask that was configured trunk sid string; the trunk this acl belonged to update destination uri updates load balancing attributes (priority, weight) for an existing destination uri important \\\<destination\\ id> is the numeric id returned when you mapped the destination uri (e g 2543) http request put https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris/\<destination id> request headers header value content type application/json request parameters parameter name mandatory/optional value priority optional integer; lower values = higher priority default 0 weight optional integer; higher values = more traffic default 1 example request curl s x put "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris/2543" \ h "content type application/json" \ d '{ "priority" 0, "weight" 5 }' http response on success, the http response status code will be 200 ok example response { "request id" "63999f0a98a24a0aa58ab5b74aec9f0a", "method" "put", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "2543", "destination" "sip 44 248 146 11 5061;transport=tls", "date created" "2026 01 23t13 38 32z", "date updated" "2026 01 23t16 05 01z", "type" "public", "priority" 0, "weight" 5, "trunk sid" "trmum1f708622631150902801a1n" } } } response parameters parameter name type & value id string; destination uri id destination string; the sip uri priority integer; updated priority weight integer; updated weight trunk sid string; the associated trunk date updated string; iso 8601 timestamp when destination was last updated delete destination uri removes a destination uri from the trunk important destination id is passed as query param id (not /destination uris/\\\<id>) http request delete https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris?id=\<destination id> example request curl s x delete "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/destination uris?id=2543" http response on success, the http response status code will be 200 ok example response { "request id" "bfc1544ab0ab4df3ae49173ccc744331", "method" "delete", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "2543", "destination" "sip 44 248 146 11 5061;transport=tls", "date created" "2026 01 23t13 38 32z", "date updated" "2026 01 23t13 38 32z", "type" "public", "priority" 0, "weight" 1, "trunk sid" "trmum1f708622631150902801a1n" } } } response parameters parameter name type & value id string; deleted destination uri id destination string; the sip uri that was removed trunk sid string; the trunk this destination belonged to update sip credential updates an existing sip digest credential entry (rotate password, rename label, or change username) important credential id is in the path (/credentials/\\\<credential\\ id>), unlike delete credentials which uses query ?id= http request put https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/credentials/\<credential id> request headers header value content type application/json request parameters parameter name mandatory/optional value user name optional string; new sip digest username password optional string; new sip digest password (use a strong secret) friendly name optional string; label to identify where the creds are used (max 32 chars) example request curl s x put "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/credentials/1234" \ h "content type application/json" \ d '{ "friendly name" "elevenlabs prod", "password" "replace with strong password" }' http response on success, the http response status code will be 200 ok example response { "request id" "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method" "put", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "1234", "trunk sid" "trmum17d8e9a37a3732ecbf91a3u", "user name" "voice ai user", "friendly name" "elevenlabs prod", "date created" "2026 01 23t11 37 36z", "date updated" "2026 01 23t16 20 00z" } } } response parameters parameter name type & value id string; credential entry id trunk sid string; the associated trunk user name string; sip digest username friendly name string or null; optional label date updated string; iso 8601 timestamp when credential was last updated list trunk settings retrieves settings configured on the trunk (for example trunk external alias / caller id) http request get https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/settings example request curl s x get "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/settings" http response on success, the http response status code will be 200 ok example response { "request id" "8ce98845365f43fd97c2f46df38438c6", "method" "get", "http code" 200, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "name" "trunk external alias", "value" "+919876543210", "trunk sid" "trmum1f708622631150902801a1n", "date created" "2026 01 23t13 34 50z", "date updated" "2026 01 23t13 34 50z" } } ] } response parameters parameter name type & value name string; setting name (e g trunk external alias) value string; setting value (e g caller id in e 164) trunk sid string; the associated trunk date created string; iso 8601 timestamp when setting was created date updated string; iso 8601 timestamp when setting was last updated delete trunk setting removes a trunk setting by name (for example clears the outbound caller id alias) important setting key is passed as query param name http request delete https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/settings?name=\<setting name> query parameters parameter name mandatory/optional value name mandatory string; setting key to remove example trunk external alias example request curl s x delete "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks/\<trunk sid>/settings?name=trunk external alias" http response on success, the http response status code will be 200 ok example response { "request id" "8ce98845365f43fd97c2f46df38438c6", "method" "delete", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "name" "trunk external alias", "value" "+919876543210", "trunk sid" "trmum1f708622631150902801a1n", "date created" "2026 01 23t13 34 50z", "date updated" "2026 01 23t13 34 50z" } } } response parameters parameter name type & value name string; deleted setting name value string; value that was removed trunk sid string; the associated trunk
