×

Associates a phone number (DID/ExoPhone) with the trunk. This phone number will be used for making and receiving calls through the trunk.

POST

https://<your_api_key>:<your_api_token>@<subdomain>/v2/accounts/<your_sid>/trunks/<trunk_sid>/phone-numbers

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

Parameter Name Mandatory/Optional Value
phone_number Mandatory String; The phone number to map to the trunk. Must be in E.164 format (with country code). Example: +919876543210+91224XXXX597
mode Optional String; Routing mode for the phone number. Can be: pstn (default) - Routes calls to telephone network, flow - Routes calls to Voice AI bot (StreamKit). If not specified, defaults to null and behaves as pstn.
curl -X POST "https://<your_api_key>:<your_api_token>@<subdomain>/v2/accounts/<your_sid>/trunks/<trunk_sid>/phone-numbers" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+919876543210"
  }'
curl -X POST "https://<your_api_key>:<your_api_token>@<subdomain>/v2/accounts/<your_sid>/trunks/<trunk_sid>/phone-numbers" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+919876543210",
    "mode": "flow"
  }'

HTTP Response

On success, the HTTP response status code will be 200 OK.

Important: Save the id from the response - this numeric ID is required for the Update Phone Number Mode API.

Response Parameters

Parameter Name Type & Value
id String; Important - Numeric identifier for this phone number mapping. Save this value - required for Update Phone Number Mode API. Example: 41512
phone_number String; The mapped phone number in E.164 format
trunk_sid String; The trunk this phone number is associated with
mode String or null; Routing mode: pstn - PSTN routing, flow - StreamKit/Voice AI routing, null - Default (same as pstn)
date_created String; ISO 8601 timestamp when mapping was created
date_updated String; ISO 8601 timestamp when mapping was last updated
{
  "request_id": "13ab9319cf574486ba299c364f82cade",
  "method": "POST",
  "http_code": 200,
  "response": {
    "code": 200,
    "error_data": null,
    "status": "success",
    "data": {
      "id": "41512",
      "phone_number": "+919876543210",
      "trunk_sid": "trmum1f708622631150902801a1n",
      "date_created": "2026-01-23T10:26:54Z",
      "date_updated": "2026-01-23T10:26:54Z",
      "mode": pstn
    }
  }
}