×

Updates the routing mode for a mapped phone number. Use this to switch between PSTN and StreamKit (Voice AI) modes.

PUT

https://<your_api_key>:<your_api_token>@<subdomain>/v2/accounts/<your_sid>/trunks/<trunk_sid>/whitelisted-ips

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

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)
curl -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"
  }'
curl -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"
  }'

HTTP Response

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

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)
{
  "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"
    }
  }
}