Map Phone Number to Trunk
Associates a phone number (DID/ExoPhone) with the trunk. This phone number will be used for making and receiving calls through the trunk.
HTTP Request
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, +912247790597 |
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 nulland behaves as pstn. |
Example Request
For StreamKit (Voice AI) mode:
HTTP Response
On success, the HTTP response status code will be 200 OK.
Important: Save the idfrom the response - this numeric ID is required for the Update Phone Number Mode API.
Example Response
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 |