# Create Inbound Trunk

You can create several type of inbound trunks: SIP, PSTN.

## Request

HTTP Method: `POST`

URI Path: `/v3/voice_in_trunks`

### Body Parameters

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| type | `string` | No | Yes | Trunks |
| attributes | `object` | No | Yes | Trunk configuration complex object. |

### Data Attributes

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| priority | `integer` | No | No | The priority of this target host. DIDWW will attempt to contact the target trunk with the lowest-numbered priority; target trunk with the same priority will be tried in an order defined by the weight field. The range is 0-65535. See [RFC 2782](https://tools.ietf.org/html/rfc2782) for more details. |
| weight | `integer` | No | No | A trunk selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights will be given a proportionately higher probability of being selected. The range of this number is 0-65535. In the presence of records containing weights greater than 0, records with weight 0 will have a very small chance of being selected. See [RFC 2782](https://tools.ietf.org/html/rfc2782) for more details. |
| capacity\_limit | `integer` | Yes | No | Maximum number of simultaneous calls for the trunk. |
| ringing\_timeout | `integer` | Yes | No | Ring time in seconds. Supported values are integers from 1 to 32. Null uses the platform default. If the call is not connected within this time, the transaction is ended with the disconnect code **Ringing timeout**. |
| name | `string` | No | Yes | Friendly name of the trunk. Unique among the trunks and trunk groups of the account - they share one name space. |
| external\_reference\_id | `string` | Yes | No | Optional identifier for the inbound trunk in the customer's external system. Maximum length is 100 characters. |
| cli\_format | `string` | Yes | No | **raw** - Do not alter CLI. **e164** - Attempt to convert CLI to E.164 format (default). **local** - Attempt to convert CLI to Localized format. **CLI format conversion may not work correctly for phone calls originating from outside the country of that specific DID**. |
| cli\_prefix | `string` | Yes | No | You may prefix the CLI with an optional `+` sign followed by up to 6 characters, including digits and `#`. |
| description | `string` | Yes | No | Optional description of the trunk. |
| pop | `string` | Yes | No | Point of Presence the trunk is pinned to. Possible values: `nyc`, `fra`, `lac`, `mia`, `sg`, `hk`, `ams`. `null` lets DIDWW choose. Any other value returns `422 Unprocessable Entity`. |
| configuration | One of [sip\_configurations](#trunk-attributes-v35), [pstn\_configurations](#trunk-attributes-v35) | No | Yes | Trunk configuration complex object. |

### Object Relationships

| Value | Description |
| --- | --- |
| voice\_in\_trunk\_group | [Trunk Group Object](../voice-in-trunk-groups/trunk-group-object.html#voice-in-trunk-group-object-v35) |

### Attributes Configuration

SIPPSTN

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| type | `sip_configurations` | No | Yes | SIP configuration complex object. |
| attributes | [sip\_configuration\_attributes](#trunk-attributes-v35) | No | Yes | SIP configuration attributes object. |

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| type | `pstn_configurations` | No | Yes | PSTN configuration complex object. |
| attributes | [pstn\_configuration\_attributes](#trunk-attributes-v35) | No | Yes | PSTN configuration attributes object. |

### Configuration Attributes

SIPPSTN

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| username | `string` | Yes | No | User part of R-URI in INVITE request. You also may use "{DID}" pattern which will be replaced by called DID number in E164 format. For example, you can set Username to "+{DID}"; if you wish to have it in +E164 format |
| host | `string` | Yes | No | Host part of R-URI in INVITE request. Required while `enabled_sip_registration` is `false`, and rejected while it is `true`. |
| port | `integer` | Yes | No | Port part of R-URI in INVITE request (is not mandatory). If port is null, SRV record will be resolved (or A record if SRV is unavailable). Must be empty while `enabled_sip_registration` is `true`. |
| codecs | Array of `strings` | No | No | Codecs offered on calls to the trunk, in priority order: the first has the highest priority. Send at least one value, without repeats. Possible values: `telephone_event`, `g723`, `g729`, `pcmu`, `pcma`, `speex`, `gsm`, `g726_32`, `g721`, `g726_24`, `g726_40`, `g726_16`, `l16`, `amr`, `amr_wb`. Defaults to `pcmu`, `pcma`, `g729`, `g723`, `telephone_event`. See [Codecs](codecs.html#trunk-codecs-v35). |
| rx\_dtmf\_format\_id | `integer` | No | No | The method id for receiving DTMF signals from customers equipment. Possible values: `1` - RFC 2833; `2` - SIP INFO `application/dtmf-relay` or `application/dtmf`; `3` - RFC 2833 or SIP INFO. |
| tx\_dtmf\_format\_id | `integer` | No | No | The method of sending DTMF signals to the customer's equipment. Possible values: `0` - Disable sending; `1` - RFC 2833; `2` - SIP INFO `application/dtmf-relay`; `4` - SIP INFO `application/dtmf`. |
| resolve\_ruri | `boolean` | No | No | Replace host part of the R-URI by resolved IP address. |
| auth\_enabled | `boolean` | No | No | Enable authorization for the SIP server. |
| auth\_user | `string` | Yes | No | Authorization user for the SIP server. Required while `auth_enabled` is `true`, and rejected while it is `false`. |
| auth\_password | `string` | Yes | No | Authorization password for the SIP server. Required while `auth_enabled` is `true`, and rejected while it is `false`. |
| auth\_from\_user | `string` | Yes | No | Specify user in a **from** field instead of CallerID (overrides CallerID). Some equipment require **from**; to be equivalent to **Auth user**. |
| auth\_from\_domain | `string` | Yes | No | Sets default **from** domain in SIP messages. Some equipment may require specific **From** Domain. |
| sst\_enabled | `boolean` | No | No | Enable SIP Session timers customization. SIP session timers are used to make sure that a session (dialog) is still alive, even though there may have been a long time since the last in-dialog message. If the other end is not responding, the dialog will be hung up automatically. SIP session timers need to be supported by all end points for it to work. It's a SIP extension, standardized by the IETF. See [RFC 4028](https://tools.ietf.org/html/rfc4028) for more details. |
| sst\_min\_timer | `integer` | Yes | No | Minimal SIP Session timer value (Default 600 seconds). See [RFC 4028](https://tools.ietf.org/html/rfc4028) for more details. |
| sst\_max\_timer | `integer` | Yes | No | Maximal SIP Session timer value (Default 900 seconds). See [RFC 4028](https://tools.ietf.org/html/rfc4028) for more details. |
| sst\_accept\_501 | `boolean` | No | No | Do not drop the call after receiving SIP 501 response for non-critical messages. |
| sip\_timer\_b | `integer` | No | No | INVITE transaction timeout (Default 8000ms). See [RFC 3261 Section 17.1.1.2](https://tools.ietf.org/html/rfc3261#section-17.1.1.2) for more details. |
| dns\_srv\_failover\_timer | `integer` | Yes | No | Invite transaction timeout for each of gateways with DNS SRV rerouting (Default 2000ms). |
| rtp\_ping | `boolean` | Yes | No | Use RTP PING when connecting a call. After establishing the call, DIDWW will send empty RTP packet **RTP PING**. It is necessary if both parties operate in Symmetric RTP / Comedia mode and expect the other party to start sending RTP first. |
| rtp\_timeout | `integer` | No | No | Disconnect the call if the RTP packets do not arrive within the specified time. |
| force\_symmetric\_rtp | `boolean` | Yes | No | Forced to work in Symmetric RTP / COMEDIA mode. |
| symmetric\_rtp\_ignore\_rtcp | `boolean` | Yes | No | Avoid switching RTP session based on RTCP packet while working in Symmetric RTP / COMEDIA. Only RTP packets will be considered. |
| rerouting\_disconnect\_code\_ids | `array` | Yes | No | [Rerouting disconnect codes](rerouting-disconnect-codes.html#disconnect-codes-v35). |
| sst\_session\_expires | `integer` | Yes | No | Session-Expires header value. Optional, should be in range with **sst\_min\_timer** and **sst\_max\_timer**. See [RFC 4028](https://tools.ietf.org/html/rfc4028) for more details. |
| sst\_refresh\_method\_id | `integer` | No | No | SIP method which will be used for session update. See [RFC 4028](https://tools.ietf.org/html/rfc4028) for more details. Possible values: `1` - Invite; `2` - Update; `3` - Update fallback Invite. |
| transport\_protocol\_id | `integer` | No | No | The transport layer that will be responsible for the actual transmission of SIP requests and responses: `1` - UDP; `2` - TCP; `3` - TLS. |
| max\_transfers | `integer` | No | No | Max count of the **REFER** requests. |
| max\_30x\_redirects | `integer` | No | No | Max count of 301/302 redirects. |
| media\_encryption\_mode | `string` | No | No | Media encryption mode. See [RFC4568 about SRTP SDES](https://datatracker.ietf.org/doc/html/rfc4568), [RFC5764 about SRTP DTLS](https://datatracker.ietf.org/doc/html/rfc5764), and [RFC6189 about ZRTP](https://datatracker.ietf.org/doc/html/rfc6189) for more details. Possible values: `disabled` - Disabled; `srtp_sdes` - SRTP SDES; `srtp_dtls` - SRTP DTLS; `zrtp` - ZRTP. |
| ice\_mode | `string` | No | No | ICE (Interactive Connectivity Establishment) for calls to the trunk: not used, accepted when the trunk offers it, or initiated by DIDWW. Possible values: `disabled`, `accept`, `initiate`. Defaults to `disabled`. |
| rtcp\_mux\_mode | `string` | No | No | RTP and RTCP multiplexed on one port: not used, accepted when the trunk offers it, or initiated by DIDWW. Possible values: `disabled`, `accept`, `initiate`. Defaults to `disabled`. |
| rtcp\_feedback\_mode | `string` | No | No | RTCP feedback (AVPF): not used, accepted when the trunk offers it, or initiated by DIDWW. Possible values: `disabled`, `accept`, `initiate`. Defaults to `disabled`. |
| stir\_shaken\_mode | `string` | No | No | Stir/Shaken mode. See [STIR/SHAKEN](../../../../voice/inbound-trunks/sip-trunks/call-information/stir-shaken-headers.html#service-did-stir-shaken) for more details. Possible values: `disabled` - Do not send identity; `original` - Transit Identity header as is; `pai` - Add PAI, P-Attestation-Indicator, P-Origination-ID; `original_pai` - Transit Identity header as is and add PAI, P-Attestation-Indicator, P-Origination-ID; `verstat` - Add P-Stir-Verstat, P-Attestation-Indicator, P-Origination-ID. |
| allowed\_rtp\_ips | Array of `strings` | Yes | No | The allowed RTP IPs: IPv4 or IPv6, single or subnet. Up to 10 items. Null means no restriction. An empty list is rejected. `0.0.0.0/0` and `::/0` are rejected. |
| network\_protocol\_priority | `string` | No | No | Network protocol priority for SIP routing. Possible values: `force_ipv4` - Use IPv4 exclusively. `force_ipv6` - Use IPv6 exclusively. `any` - Use either IPv4 or IPv6. `prefer_ipv4` - Prefer IPv4 but fall back to IPv6. `prefer_ipv6` - Prefer IPv6 but fall back to IPv4. |
| enabled\_sip\_registration | `boolean` | No | No | Enables SIP registration for the trunk. Enabling it generates `incoming_auth_username` and `incoming_auth_password`. |
| use\_did\_in\_ruri | `boolean` | No | No | Uses the called DID in the R-URI. Requires `enabled_sip_registration` to be `true`: sending `true` while it is `false` returns `422 Unprocessable Entity`. |
| diversion\_relay\_policy | `string` | No | No | Controls how Diversion information is relayed. Possible values: `none` - Do not relay the Diversion header. `as_is` - Relay the Diversion header as received. `sip` - Relay the Diversion header as a SIP URI. `tel` - Relay the Diversion header as a TEL URI. |
| diversion\_inject\_mode | `string` | No | No | Controls how Diversion information is injected. Possible values: `none` - Do not add a Diversion header. `did_number` - Add a Diversion header using the DID number in E.164 format. |
| cnam\_lookup | `boolean` | No | No | Enables inbound CNAM lookup. |

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| dst | `string` | No | Yes | Number calls are forwarded to, in E.164 without the leading `+`. Digits only, up to 15 digits. |

## Examples

SIPSIP with registrationPSTNSIP with POP

[[DIDWW-API-EXAMPLE-START]]

http

```
 1POST /v3/voice_in_trunks HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "type": "voice_in_trunks",
10    "attributes": {
11      "priority": 1,
12      "weight": 2,
13      "capacity_limit": 10,
14      "ringing_timeout": 30,
15      "name": "Office",
16      "cli_format": "e164",
17      "cli_prefix": "+",
18      "description": "custom description",
19      "configuration": {
20        "type": "sip_configurations",
21        "attributes": {
22          "username": "username",
23          "host": "example.com",
24          "port": 5060,
25          "codecs": [
26            "pcmu",
27            "g723"
28          ],
29          "rx_dtmf_format_id": 1,
30          "tx_dtmf_format_id": 1,
31          "resolve_ruri": true,
32          "auth_enabled": true,
33          "auth_user": "username",
34          "auth_password": "password",
35          "auth_from_user": "Office",
36          "auth_from_domain": "example.com",
37          "sst_enabled": false,
38          "sst_min_timer": 600,
39          "sst_max_timer": 900,
40          "sst_accept_501": true,
41          "sip_timer_b": 8000,
42          "dns_srv_failover_timer": 2000,
43          "rtp_ping": false,
44          "rtp_timeout": 30,
45          "force_symmetric_rtp": false,
46          "symmetric_rtp_ignore_rtcp": false,
47          "rerouting_disconnect_code_ids": [
48            58,
49            59
50          ],
51          "sst_session_expires": null,
52          "sst_refresh_method_id": 1,
53          "transport_protocol_id": 2,
54          "max_transfers": 0,
55          "max_30x_redirects": 0,
56          "media_encryption_mode": "disabled",
57          "ice_mode": "disabled",
58          "rtcp_mux_mode": "disabled",
59          "rtcp_feedback_mode": "disabled",
60          "stir_shaken_mode": "disabled",
61          "allowed_rtp_ips": null,
62          "network_protocol_priority": "prefer_ipv4",
63          "diversion_relay_policy": "sip",
64          "diversion_inject_mode": "did_number",
65          "cnam_lookup": true
66        }
67      }
68    }
69  }
70}
```

curl

```
1curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"capacity_limit": 10, "cli_format": "e164", "cli_prefix": "+", "configuration": {"attributes": {"allowed_rtp_ips": null, "auth_enabled": true, "auth_from_domain": "example.com", "auth_from_user": "Office", "auth_password": "password", "auth_user": "username", "cnam_lookup": true, "codecs": ["pcmu", "g723"], "diversion_inject_mode": "did_number", "diversion_relay_policy": "sip", "dns_srv_failover_timer": 2000, "force_symmetric_rtp": false, "host": "example.com", "ice_mode": "disabled", "max_30x_redirects": 0, "max_transfers": 0, "media_encryption_mode": "disabled", "network_protocol_priority": "prefer_ipv4", "port": 5060, "rerouting_disconnect_code_ids": [58, 59], "resolve_ruri": true, "rtcp_feedback_mode": "disabled", "rtcp_mux_mode": "disabled", "rtp_ping": false, "rtp_timeout": 30, "rx_dtmf_format_id": 1, "sip_timer_b": 8000, "sst_accept_501": true, "sst_enabled": false, "sst_max_timer": 900, "sst_min_timer": 600, "sst_refresh_method_id": 1, "sst_session_expires": null, "stir_shaken_mode": "disabled", "symmetric_rtp_ignore_rtcp": false, "transport_protocol_id": 2, "tx_dtmf_format_id": 1, "username": "username"}, "type": "sip_configurations"}, "description": "custom description", "name": "Office", "priority": 1, "ringing_timeout": 30, "weight": 2}, "type": "voice_in_trunks"}}'
```

response

```
 1HTTP/1.1 201 Created
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "f36d1d17-bd16-42b9-af42-0cfe166bf3ec",
 7    "type": "voice_in_trunks",
 8    "attributes": {
 9      "priority": 1,
10      "capacity_limit": 10,
11      "weight": 2,
12      "name": "Office",
13      "cli_format": "e164",
14      "cli_prefix": "+",
15      "description": "custom description",
16      "ringing_timeout": 30,
17      "pop": null,
18      "created_at": "2017-06-25T08:21:41.795Z",
19      "external_reference_id": null,
20      "configuration": {
21        "type": "sip_configurations",
22        "attributes": {
23          "username": "username",
24          "host": "example.com",
25          "port": 5060,
26          "codecs": [
27            "pcmu",
28            "g723"
29          ],
30          "rx_dtmf_format_id": 1,
31          "tx_dtmf_format_id": 1,
32          "resolve_ruri": true,
33          "auth_enabled": true,
34          "auth_user": "username",
35          "auth_password": "password",
36          "auth_from_user": "Office",
37          "auth_from_domain": "example.com",
38          "sst_enabled": false,
39          "sst_min_timer": 600,
40          "sst_max_timer": 900,
41          "sst_accept_501": true,
42          "sip_timer_b": 8000,
43          "dns_srv_failover_timer": 2000,
44          "rtp_ping": false,
45          "rtp_timeout": 30,
46          "force_symmetric_rtp": false,
47          "symmetric_rtp_ignore_rtcp": false,
48          "rerouting_disconnect_code_ids": [
49            58,
50            59
51          ],
52          "sst_session_expires": null,
53          "sst_refresh_method_id": 1,
54          "transport_protocol_id": 2,
55          "max_transfers": 0,
56          "max_30x_redirects": 0,
57          "media_encryption_mode": "disabled",
58          "ice_mode": "disabled",
59          "rtcp_mux_mode": "disabled",
60          "rtcp_feedback_mode": "disabled",
61          "stir_shaken_mode": "disabled",
62          "allowed_rtp_ips": null,
63          "network_protocol_priority": "prefer_ipv4",
64          "enabled_sip_registration": false,
65          "use_did_in_ruri": false,
66          "incoming_auth_username": null,
67          "incoming_auth_password": null,
68          "diversion_relay_policy": "sip",
69          "diversion_inject_mode": "did_number",
70          "cnam_lookup": true
71        }
72      }
73    },
74    "relationships": {
75      "voice_in_trunk_group": {
76        "links": {
77          "self": "https://api.didww.com/v3/voice_in_trunks/f36d1d17-bd16-42b9-af42-0cfe166bf3ec/relationships/voice_in_trunk_group",
78          "related": "https://api.didww.com/v3/voice_in_trunks/f36d1d17-bd16-42b9-af42-0cfe166bf3ec/voice_in_trunk_group"
79        }
80      }
81    }
82  },
83  "meta": {
84    "api_version": "2026-11-19"
85  }
86}
```

[[DIDWW-API-EXAMPLE-END]]

When `enabled_sip_registration` is `true`, do not send `host` or `port` in the create request.

[[DIDWW-API-EXAMPLE-START]]

http

```
 1POST /v3/voice_in_trunks HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "type": "voice_in_trunks",
10    "attributes": {
11      "priority": 1,
12      "weight": 2,
13      "name": "Office Registration",
14      "capacity_limit": 10,
15      "ringing_timeout": 30,
16      "cli_format": "e164",
17      "cli_prefix": "+",
18      "description": "custom description",
19      "configuration": {
20        "type": "sip_configurations",
21        "attributes": {
22          "username": "office-registration",
23          "codecs": [
24            "pcmu",
25            "g723"
26          ],
27          "rx_dtmf_format_id": 1,
28          "tx_dtmf_format_id": 1,
29          "resolve_ruri": false,
30          "auth_enabled": true,
31          "auth_user": "office-registration",
32          "auth_password": "password",
33          "auth_from_user": "OfficeRegistration",
34          "auth_from_domain": "example.com",
35          "sst_enabled": false,
36          "sst_min_timer": 600,
37          "sst_max_timer": 900,
38          "sst_accept_501": true,
39          "sip_timer_b": 8000,
40          "dns_srv_failover_timer": 2000,
41          "rtp_ping": false,
42          "rtp_timeout": 30,
43          "force_symmetric_rtp": false,
44          "symmetric_rtp_ignore_rtcp": false,
45          "rerouting_disconnect_code_ids": [
46            58,
47            59
48          ],
49          "sst_session_expires": null,
50          "sst_refresh_method_id": 1,
51          "transport_protocol_id": 2,
52          "max_transfers": 0,
53          "max_30x_redirects": 0,
54          "media_encryption_mode": "disabled",
55          "ice_mode": "disabled",
56          "rtcp_mux_mode": "disabled",
57          "rtcp_feedback_mode": "disabled",
58          "stir_shaken_mode": "disabled",
59          "allowed_rtp_ips": null,
60          "network_protocol_priority": "prefer_ipv4",
61          "enabled_sip_registration": true,
62          "use_did_in_ruri": true,
63          "diversion_relay_policy": "sip",
64          "diversion_inject_mode": "did_number",
65          "cnam_lookup": true
66        }
67      }
68    }
69  }
70}
```

curl

```
1curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"capacity_limit": 10, "cli_format": "e164", "cli_prefix": "+", "configuration": {"attributes": {"allowed_rtp_ips": null, "auth_enabled": true, "auth_from_domain": "example.com", "auth_from_user": "OfficeRegistration", "auth_password": "password", "auth_user": "office-registration", "cnam_lookup": true, "codecs": ["pcmu", "g723"], "diversion_inject_mode": "did_number", "diversion_relay_policy": "sip", "dns_srv_failover_timer": 2000, "enabled_sip_registration": true, "force_symmetric_rtp": false, "ice_mode": "disabled", "max_30x_redirects": 0, "max_transfers": 0, "media_encryption_mode": "disabled", "network_protocol_priority": "prefer_ipv4", "rerouting_disconnect_code_ids": [58, 59], "resolve_ruri": false, "rtcp_feedback_mode": "disabled", "rtcp_mux_mode": "disabled", "rtp_ping": false, "rtp_timeout": 30, "rx_dtmf_format_id": 1, "sip_timer_b": 8000, "sst_accept_501": true, "sst_enabled": false, "sst_max_timer": 900, "sst_min_timer": 600, "sst_refresh_method_id": 1, "sst_session_expires": null, "stir_shaken_mode": "disabled", "symmetric_rtp_ignore_rtcp": false, "transport_protocol_id": 2, "tx_dtmf_format_id": 1, "use_did_in_ruri": true, "username": "office-registration"}, "type": "sip_configurations"}, "description": "custom description", "name": "Office Registration", "priority": 1, "ringing_timeout": 30, "weight": 2}, "type": "voice_in_trunks"}}'
```

response

```
 1HTTP/1.1 201 Created
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1",
 7    "type": "voice_in_trunks",
 8    "attributes": {
 9      "priority": 1,
10      "capacity_limit": 10,
11      "weight": 2,
12      "name": "Office Registration",
13      "cli_format": "e164",
14      "cli_prefix": "+",
15      "description": "custom description",
16      "ringing_timeout": 30,
17      "pop": null,
18      "created_at": "2026-04-27T09:15:00.000Z",
19      "external_reference_id": null,
20      "configuration": {
21        "type": "sip_configurations",
22        "attributes": {
23          "username": "office-registration",
24          "host": null,
25          "port": null,
26          "codecs": [
27            "pcmu",
28            "g723"
29          ],
30          "rx_dtmf_format_id": 1,
31          "tx_dtmf_format_id": 1,
32          "resolve_ruri": false,
33          "auth_enabled": true,
34          "auth_user": "office-registration",
35          "auth_password": "password",
36          "auth_from_user": "OfficeRegistration",
37          "auth_from_domain": "example.com",
38          "sst_enabled": false,
39          "sst_min_timer": 600,
40          "sst_max_timer": 900,
41          "sst_accept_501": true,
42          "sip_timer_b": 8000,
43          "dns_srv_failover_timer": 2000,
44          "rtp_ping": false,
45          "rtp_timeout": 30,
46          "force_symmetric_rtp": false,
47          "symmetric_rtp_ignore_rtcp": false,
48          "rerouting_disconnect_code_ids": [
49            58,
50            59
51          ],
52          "sst_session_expires": null,
53          "sst_refresh_method_id": 1,
54          "transport_protocol_id": 2,
55          "max_transfers": 0,
56          "max_30x_redirects": 0,
57          "media_encryption_mode": "disabled",
58          "ice_mode": "disabled",
59          "rtcp_mux_mode": "disabled",
60          "rtcp_feedback_mode": "disabled",
61          "stir_shaken_mode": "disabled",
62          "allowed_rtp_ips": null,
63          "network_protocol_priority": "prefer_ipv4",
64          "enabled_sip_registration": true,
65          "use_did_in_ruri": true,
66          "incoming_auth_username": "k3v******",
67          "incoming_auth_password": "t8q******",
68          "diversion_relay_policy": "sip",
69          "diversion_inject_mode": "did_number",
70          "cnam_lookup": true
71        }
72      }
73    },
74    "relationships": {
75      "voice_in_trunk_group": {
76        "links": {
77          "self": "https://api.didww.com/v3/voice_in_trunks/5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1/relationships/voice_in_trunk_group",
78          "related": "https://api.didww.com/v3/voice_in_trunks/5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1/voice_in_trunk_group"
79        }
80      }
81    }
82  },
83  "meta": {
84    "api_version": "2026-11-19"
85  }
86}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
 1POST /v3/voice_in_trunks HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "type": "voice_in_trunks",
10    "attributes": {
11      "name": "Office Mobile",
12      "capacity_limit": 5,
13      "configuration": {
14        "type": "pstn_configurations",
15        "attributes": {
16          "dst": "1xxxxxxxxx"
17        }
18      }
19    }
20  }
21}
```

curl

```
1curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"capacity_limit": 5, "configuration": {"attributes": {"dst": "1xxxxxxxxx"}, "type": "pstn_configurations"}, "name": "Office Mobile"}, "type": "voice_in_trunks"}}'
```

response

```
 1HTTP/1.1 201 Created
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "28b360b9-0d35-4c94-bbfd-1c33a7680b34",
 7    "type": "voice_in_trunks",
 8    "attributes": {
 9      "priority": 1,
10      "capacity_limit": 5,
11      "weight": 65535,
12      "name": "Office Mobile",
13      "cli_format": "e164",
14      "cli_prefix": null,
15      "description": null,
16      "ringing_timeout": null,
17      "pop": null,
18      "created_at": "2017-06-25T08:21:41.795Z",
19      "external_reference_id": null,
20      "configuration": {
21        "type": "pstn_configurations",
22        "attributes": {
23          "dst": "1xxxxxxxxx"
24        }
25      }
26    },
27    "relationships": {
28      "voice_in_trunk_group": {
29        "links": {
30          "self": "https://api.didww.com/v3/voice_in_trunks/28b360b9-0d35-4c94-bbfd-1c33a7680b34/relationships/voice_in_trunk_group",
31          "related": "https://api.didww.com/v3/voice_in_trunks/28b360b9-0d35-4c94-bbfd-1c33a7680b34/voice_in_trunk_group"
32        }
33      }
34    }
35  },
36  "meta": {
37    "api_version": "2026-11-19"
38  }
39}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
 1POST /v3/voice_in_trunks HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "type": "voice_in_trunks",
10    "attributes": {
11      "name": "Office SIP",
12      "capacity_limit": 18,
13      "cli_format": "e164",
14      "cli_prefix": "+1",
15      "pop": "nyc",
16      "configuration": {
17        "type": "sip_configurations",
18        "attributes": {
19          "username": "username",
20          "host": "example.com",
21          "codecs": [
22            "pcmu",
23            "g723"
24          ],
25          "rx_dtmf_format_id": 1,
26          "tx_dtmf_format_id": 1,
27          "resolve_ruri": true,
28          "auth_enabled": true,
29          "auth_user": "username",
30          "auth_password": "password",
31          "auth_from_user": "Office",
32          "auth_from_domain": "example.com",
33          "sst_enabled": false,
34          "sst_min_timer": 600,
35          "sst_max_timer": 900,
36          "sst_refresh_method_id": 1,
37          "sst_accept_501": true,
38          "sip_timer_b": 8000,
39          "dns_srv_failover_timer": 2000,
40          "rtp_ping": false,
41          "rtp_timeout": 30,
42          "force_symmetric_rtp": false,
43          "symmetric_rtp_ignore_rtcp": false,
44          "rerouting_disconnect_code_ids": [
45            58,
46            59
47          ],
48          "port": 5060,
49          "transport_protocol_id": 2,
50          "max_transfers": 0,
51          "max_30x_redirects": 0,
52          "media_encryption_mode": "disabled",
53          "ice_mode": "disabled",
54          "rtcp_mux_mode": "disabled",
55          "rtcp_feedback_mode": "disabled",
56          "stir_shaken_mode": "disabled",
57          "allowed_rtp_ips": null
58        }
59      }
60    }
61  }
62}
```

curl

```
1curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"capacity_limit": 18, "cli_format": "e164", "cli_prefix": "+1", "configuration": {"attributes": {"allowed_rtp_ips": null, "auth_enabled": true, "auth_from_domain": "example.com", "auth_from_user": "Office", "auth_password": "password", "auth_user": "username", "codecs": ["pcmu", "g723"], "dns_srv_failover_timer": 2000, "force_symmetric_rtp": false, "host": "example.com", "ice_mode": "disabled", "max_30x_redirects": 0, "max_transfers": 0, "media_encryption_mode": "disabled", "port": 5060, "rerouting_disconnect_code_ids": [58, 59], "resolve_ruri": true, "rtcp_feedback_mode": "disabled", "rtcp_mux_mode": "disabled", "rtp_ping": false, "rtp_timeout": 30, "rx_dtmf_format_id": 1, "sip_timer_b": 8000, "sst_accept_501": true, "sst_enabled": false, "sst_max_timer": 900, "sst_min_timer": 600, "sst_refresh_method_id": 1, "stir_shaken_mode": "disabled", "symmetric_rtp_ignore_rtcp": false, "transport_protocol_id": 2, "tx_dtmf_format_id": 1, "username": "username"}, "type": "sip_configurations"}, "name": "Office SIP", "pop": "nyc"}, "type": "voice_in_trunks"}}'
```

response

```
 1HTTP/1.1 201 Created
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "7adfab4e-83bc-45e2-84e6-60342a505713",
 7    "type": "voice_in_trunks",
 8    "attributes": {
 9      "priority": 1,
10      "capacity_limit": 18,
11      "weight": 65535,
12      "name": "Office SIP",
13      "cli_format": "e164",
14      "cli_prefix": "+1",
15      "description": null,
16      "ringing_timeout": null,
17      "pop": "nyc",
18      "created_at": "2017-06-25T08:21:41.795Z",
19      "external_reference_id": null,
20      "configuration": {
21        "type": "sip_configurations",
22        "attributes": {
23          "username": "username",
24          "host": "example.com",
25          "port": 5060,
26          "codecs": [
27            "pcmu",
28            "g723"
29          ],
30          "rx_dtmf_format_id": 1,
31          "tx_dtmf_format_id": 1,
32          "resolve_ruri": true,
33          "auth_enabled": true,
34          "auth_user": "username",
35          "auth_password": "password",
36          "auth_from_user": "Office",
37          "auth_from_domain": "example.com",
38          "sst_enabled": false,
39          "sst_min_timer": 600,
40          "sst_max_timer": 900,
41          "sst_accept_501": true,
42          "sip_timer_b": 8000,
43          "dns_srv_failover_timer": 2000,
44          "rtp_ping": false,
45          "rtp_timeout": 30,
46          "force_symmetric_rtp": false,
47          "symmetric_rtp_ignore_rtcp": false,
48          "rerouting_disconnect_code_ids": [
49            58,
50            59
51          ],
52          "sst_session_expires": null,
53          "sst_refresh_method_id": 1,
54          "transport_protocol_id": 2,
55          "max_transfers": 0,
56          "max_30x_redirects": 0,
57          "media_encryption_mode": "disabled",
58          "ice_mode": "disabled",
59          "rtcp_mux_mode": "disabled",
60          "rtcp_feedback_mode": "disabled",
61          "stir_shaken_mode": "disabled",
62          "allowed_rtp_ips": null,
63          "network_protocol_priority": "force_ipv4",
64          "enabled_sip_registration": false,
65          "use_did_in_ruri": false,
66          "incoming_auth_username": null,
67          "incoming_auth_password": null,
68          "diversion_relay_policy": "none",
69          "diversion_inject_mode": "did_number",
70          "cnam_lookup": false
71        }
72      }
73    },
74    "relationships": {
75      "voice_in_trunk_group": {
76        "links": {
77          "self": "https://api.didww.com/v3/voice_in_trunks/7adfab4e-83bc-45e2-84e6-60342a505713/relationships/voice_in_trunk_group",
78          "related": "https://api.didww.com/v3/voice_in_trunks/7adfab4e-83bc-45e2-84e6-60342a505713/voice_in_trunk_group"
79        }
80      }
81    }
82  },
83  "meta": {
84    "api_version": "2026-11-19"
85  }
86}
```

[[DIDWW-API-EXAMPLE-END]]

## Other Responses

| Code | Success | Description |
| --- | --- | --- |
| 422 | No | [Unprocessable Entity](../../../specification/errors/index.html#api-validation-error-object) |
| 400 | No | [Bad Request](../../../specification/errors/index.html#api-bad-request). The body is malformed: `configuration` is missing, or it carries a member the API does not accept. Also returned with the title `Quota limit reached` when the account has reached its limit of inbound trunks. |
| 401 | No | [Unauthorized](../../authentication.html#authentication-v35) |
| 403 | No | The access token carries the `read` scope, which does not cover this method (title `Insufficient scope`). The response carries `WWW-Authenticate: Bearer error="insufficient_scope"`. See [Scopes](../../authentication.html#authentication-scopes-v35). |
| 429 | No | The request budget of the account for the current window is spent (`too_many_requests`). `Retry-After` gives the number of seconds to wait. |
