---
title: Map Phone Number to Trunk
slug: dynamic-sip-trunking/map-phone-number-to-trunk
createdAt: 2026-08-10T10:40:12.512Z
---

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

:::BlockQuote
POST https\://\<your\_api\_key>:\<your\_api\_token>@\<subdomain>/v2/accounts/\<your\_sid>/trunks/\<trunk\_sid>/phone-numbers
:::

### 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

:::BlockQuote
curl -s -X POST "https\://\<your\_api\_key>:\<your\_api\_token>@\<subdomain>/v2/accounts/\<your\_sid>/trunks/\<trunk\_sid>/phone-numbers" \\
&#x20; -H "Content-Type: application/json" \\
&#x20; -d '\{
&#x20;   "phone\_number": "+919876543210"
&#x20; }'
:::

**For StreamKit (Voice AI) mode:**

:::BlockQuote
curl -s -X POST "https\://\<your\_api\_key>:\<your\_api\_token>@\<subdomain>/v2/accounts/\<your\_sid>/trunks/\<trunk\_sid>/phone-numbers" \\
&#x20; -H "Content-Type: application/json" \\
&#x20; -d '\{
&#x20;   "phone\_number": "+919876543210",
&#x20;   "mode": "flow"
&#x20; }'
:::

### 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

:::BlockQuote
\{
&#x20; "request\_id": "13ab9319cf574486ba299c364f82cade",
&#x20; "method": "POST",
&#x20; "http\_code": 200,
&#x20; "response": \{
&#x20;   "code": 200,
&#x20;   "error\_data": null,
&#x20;   "status": "success",
&#x20;   "data": \{
&#x20;     "id": "41512",
&#x20;     "phone\_number": "+919876543210",
&#x20;     "trunk\_sid": "trmum1f708622631150902801a1n",
&#x20;     "date\_created": "2026-01-23T10:26:54Z",
&#x20;     "date\_updated": "2026-01-23T10:26:54Z",
&#x20;     "mode": null
&#x20;   }
&#x20; }
}
:::

### 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                                                                                              |

