Create Trunk
7 min
creates a new sip trunk this is the first step for all sip trunking use cases a sip trunk acts as a virtual connection between your communication system (pbx/contact center) and exotel's telephony network http request post https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks request headers header value content type application/json request parameters the following parameters are sent as json in the body of the request parameter name mandatory/optional value trunk name mandatory string; unique identifier for the trunk must be alphanumeric with underscores only, maximum 16 characters example outbound trunk, my pbx trunk nso code mandatory string; network service operator code use any anyfor standard configuration domain name mandatory string; sip domain for the trunk format \<your sid> pstn exotel com example ameyo5m pstn exotel com example request curl s x post "https //\<your api key> \<your api token>@\<subdomain>/v2/accounts/\<your sid>/trunks" \\ h "content type application/json" \\ d '{ "trunk name" "outbound trunk", "nso code" "any any", "domain name" "\<your sid> pstn exotel com" }' http response on success, the http response status code will be 200 ok the trunk sidis the unique identifier of the trunk save this value as it will be required for all subsequent api calls example response { "request id" "10a67da360d446378d5c2b66407b7f18", "method" "post", "http code" 200, "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 request id string; unique identifier for this api request method string; http method used (post) http code integer; http status code (200 for success) trunk sid string; important unique identifier for the trunk save this for subsequent api calls example trmum1f708622631150902801a1n trunk name string; name of the trunk as provided in request domain name string; sip domain for the trunk status string; current trunk status active trunk is ready for use, inactive trunk is disabled auth type string; authentication type currently only ip whitelistis supported registration enabled string; sip registration status enabledor disabled edge preference string; edge server preference default auto nso code string; network service operator code secure trunking string; tls status enabledor disabled destination uris string; api path to manage destination uris for this trunk whitelisted ips string; api path to manage acls (whitelisted ips) for this trunk credentials string; api path to credentials for this trunk phone numbers string; api path to manage phone numbers for this trunk date created string; iso 8601 timestamp when trunk was created date updated string; iso 8601 timestamp when trunk was last updated
