×

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.

POST

https://<your_api_key>:<your_api_token>@<subdomain>/v2/accounts/<your_sid>/trunks

Replace <your_api_key> and <your_api_token> with the API key and token created by you.

  • Replace <your_sid> with your “Account sid”
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<your_api_key> , <your_api_token> and <your_sid> are available in the API settings page of your Exotel Dashboard

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_trunkmy_pbx_trunk
nso_code Mandatory String; Network Service Operator code. Use ANY-ANY for standard configuration.
domain_name Mandatory String; SIP domain for the trunk. Format: <your_sid>.pstn.exotel.com. Example: ameyo5m.pstn.exotel.com
curl -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"
  }'

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-WHITELIST is supported
registration_enabled String; SIP registration status: enabled or disabled
edge_preference String; Edge server preference. Default: auto
nso_code String; Network Service Operator code
secure_trunking String; TLS status: enabled or 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
{
  "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"
    }
  }
}