# 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 | Yes | 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 | Yes | 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` | No | No | Maximum number of simultaneous calls for the trunk. |
| ringing\_timeout | `integer` | No | No | Ring time in seconds. Supported values are integers from 1 to 32. If `null`, the timeout is undefined.   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. |
| 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` | No | No | **RAW** - Do not alter CLI (default).   **E164** - Attempt to convert CLI to E.164 format.   **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` | No | No | You may prefix the CLI with an optional `+` sign followed by up to 6 characters, including digits and `#`. |
| description | `string` | No | No | Optional description of the trunk. |
| configuration | One of [sip\_configurations](#trunk-attributes-v34),   [pstn\_configurations](#trunk-attributes-v34) | N/A | 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-v34) |
| pop | [POP Object](pop-object.html#pop-object-v34) |

### Attributes Configuration

SIPPSTN

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| type | `sip_configurations` | No | Yes | SIP configuration complex object. |
| attributes | [sip\_configuration\_attributes](#trunk-attributes-v34) | 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-v34) | No | Yes | PSTN configuration attributes object. |

### Configuration Attributes

SIPPSTN

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| username | `string` | No | Yes | 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` | No | Yes | Host part of R-URI in INVITE request. |
| port | `integer` | No | 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). |
| codec\_ids | `array` | No | No | [Codecs](codecs.html#trunk-codecs-v34). |
| 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 customers equipment.   Possible values:   1 - Disable sending   2 - RFC 2833   3 - 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` | No | No | Optional authorization user for the SIP server. |
| auth\_password | `string` | No | No | Optional authorization password for the SIP server. |
| auth\_from\_user | `string` | No | 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` | No | 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` | No | 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` | No | 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` | No | No | Invite transaction timeout for each of gateways with DNS SRV rerouting (Default 2000ms). |
| rtp\_ping | `boolean` | No | 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` | No | No | Forced to work in Symmetric RTP / COMEDIA mode. |
| symmetric\_rtp\_ignore\_rtcp | `boolean` | No | 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` | No | No | [Rerouting disconnect codes](rerouting-disconnect-codes.html#disconnect-codes-v34). |
| sst\_session\_expires | `integer` | No | 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 |
| stir\_shaken\_mode | `string` | No | No | Stir/Shaken mode.   See [STIR/SHAKEN](../../../../voice/inbound-trunks/technical-data/stir-shaken.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 + 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` | No | No | The allowed RTP IPs. Array from 0 to 10 items: IPv4 or IPv6, single or subnet. |
| 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. |
| use\_did\_in\_ruri | `boolean` | No | No | Uses the called DID in the R-URI. This attribute works only when `enabled_sip_registration` is `true`. |
| 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 | Phone number's. |

## Examples

SIPSIP with registrationPSTNSIP with POP

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_in_trunks HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunks",
    "attributes": {
      "priority": "1",
      "weight": "2",
      "capacity_limit": 10,
      "ringing_timeout": 30,
      "name": "Office",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "port": 5060,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": "true",
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": "false",
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": "true",
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": "false",
          "rtp_timeout": 30,
          "force_symmetric_rtp": "false",
          "symmetric_rtp_ignore_rtcp": "false",
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1,
          "transport_protocol_id": 2,
          "max_transfers": 0,
          "max_30x_redirects": 0,
          "media_encryption_mode": "disabled",
          "stir_shaken_mode": "disabled",
          "allowed_rtp_ips": null,
          "network_protocol_priority": "prefer_ipv4",
          "diversion_relay_policy": "sip",
          "diversion_inject_mode": "did_number",
          "cnam_lookup": true
        }
      }
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --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, "codec_ids": [9, 7], "diversion_inject_mode": "did_number", "diversion_relay_policy": "sip", "dns_srv_failover_timer": 2000, "force_symmetric_rtp": "false", "host": "example.com", "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", "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

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "f36d1d17-bd16-42b9-af42-0cfe166bf3ec",
    "type": "voice_in_trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 10,
      "weight": 2,
      "name": "Office",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "ringing_timeout": 30,
      "created_at": "2017-06-25T08:21:41.795Z",
      "external_reference_id": null,
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "port": 5060,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": true,
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": false,
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": true,
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": false,
          "rtp_timeout": 30,
          "force_symmetric_rtp": false,
          "symmetric_rtp_ignore_rtcp": false,
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1,
          "transport_protocol_id": 2,
          "max_transfers": 0,
          "max_30x_redirects": 0,
          "media_encryption_mode": "disabled",
          "stir_shaken_mode": "disabled",
          "allowed_rtp_ips": null,
          "network_protocol_priority": "prefer_ipv4",
          "diversion_relay_policy": "sip",
          "diversion_inject_mode": "did_number",
          "cnam_lookup": true
        }
      }
    },
    "relationships": {
      "voice_in_trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/f36d1d17-bd16-42b9-af42-0cfe166bf3ec/relationships/voice_in_trunk_group",
          "related": "https://api.didww.com/v3/voice_in_trunks/f36d1d17-bd16-42b9-af42-0cfe166bf3ec/voice_in_trunk_group"
        }
      },
      "pop": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/f36d1d17-bd16-42b9-af42-0cfe166bf3ec/relationships/pop",
          "related": "https://api.didww.com/v3/voice_in_trunks/f36d1d17-bd16-42b9-af42-0cfe166bf3ec/pop"
        }
      }
    }
}
}
```

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

```
POST /v3/voice_in_trunks HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunks",
    "attributes": {
      "priority": "1",
      "weight": "2",
      "name": "Office Registration",
      "capacity_limit": 10,
      "ringing_timeout": 30,
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "office-registration",
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": "false",
          "auth_enabled": true,
          "auth_user": "office-registration",
          "auth_password": "password",
          "auth_from_user": "OfficeRegistration",
          "auth_from_domain": "example.com",
          "sst_enabled": "false",
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": "true",
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": "false",
          "rtp_timeout": 30,
          "force_symmetric_rtp": "false",
          "symmetric_rtp_ignore_rtcp": "false",
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1,
          "transport_protocol_id": 2,
          "max_transfers": 0,
          "max_30x_redirects": 0,
          "media_encryption_mode": "disabled",
          "stir_shaken_mode": "disabled",
          "allowed_rtp_ips": null,
          "network_protocol_priority": "prefer_ipv4",
          "enabled_sip_registration": true,
          "use_did_in_ruri": true,
          "diversion_relay_policy": "sip",
          "diversion_inject_mode": "did_number",
          "cnam_lookup": true
        }
      }
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --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, "codec_ids": [9, 7], "diversion_inject_mode": "did_number", "diversion_relay_policy": "sip", "dns_srv_failover_timer": 2000, "enabled_sip_registration": true, "force_symmetric_rtp": "false", "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", "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

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1",
    "type": "voice_in_trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 10,
      "weight": 2,
      "name": "Office Registration",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "ringing_timeout": 30,
      "created_at": "2026-04-27T09:15:00.000Z",
      "external_reference_id": null,
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "office-registration",
          "host": null,
          "port": null,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": false,
          "auth_enabled": true,
          "auth_user": "office-registration",
          "auth_password": "password",
          "auth_from_user": "OfficeRegistration",
          "auth_from_domain": "example.com",
          "sst_enabled": false,
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": true,
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": false,
          "rtp_timeout": 30,
          "force_symmetric_rtp": false,
          "symmetric_rtp_ignore_rtcp": false,
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1,
          "transport_protocol_id": 2,
          "max_transfers": 0,
          "max_30x_redirects": 0,
          "media_encryption_mode": "disabled",
          "stir_shaken_mode": "disabled",
          "allowed_rtp_ips": null,
          "network_protocol_priority": "prefer_ipv4",
          "enabled_sip_registration": true,
          "use_did_in_ruri": true,
          "diversion_relay_policy": "sip",
          "diversion_inject_mode": "did_number",
          "cnam_lookup": true
        }
      }
    },
    "relationships": {
      "voice_in_trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1/relationships/voice_in_trunk_group",
          "related": "https://api.didww.com/v3/voice_in_trunks/5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1/voice_in_trunk_group"
        }
      },
      "pop": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1/relationships/pop",
          "related": "https://api.didww.com/v3/voice_in_trunks/5b59c2b0-2a3b-4a17-b8f9-d4df5e8ad2b1/pop"
        }
      }
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_in_trunks HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunks",
    "attributes": {
      "name": "Office Mobile",
      "capacity_limit": 5,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx"
        }
      }
    }
  }
}
```

curl

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

response

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "28b360b9-0d35-4c94-bbfd-1c33a7680b34",
    "type": "voice_in_trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 5,
      "weight": 65535,
      "name": "Office Mobile",
      "cli_format": "e164",
      "cli_prefix": null,
      "description": null,
      "ringing_timeout": null,
      "created_at": "2017-06-25T08:21:41.795Z",
      "external_reference_id": null,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx"
        }
      }
    },
    "relationships": {
      "voice_in_trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/28b360b9-0d35-4c94-bbfd-1c33a7680b34/relationships/voice_in_trunk_group",
          "related": "https://api.didww.com/v3/voice_in_trunks/28b360b9-0d35-4c94-bbfd-1c33a7680b34/voice_in_trunk_group"
        }
      },
      "pop": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/28b360b9-0d35-4c94-bbfd-1c33a7680b34/relationships/pop",
          "related": "https://api.didww.com/v3/voice_in_trunks/28b360b9-0d35-4c94-bbfd-1c33a7680b34/pop"
        }
      }
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_in_trunks HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunks",
    "attributes": {
      "name": "Office SIP",
      "capacity_limit": 18,
      "cli_format": "e164",
      "cli_prefix": "+1",
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": "true",
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": "false",
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_refresh_method_id": 1,
          "sst_accept_501": "true",
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": "false",
          "rtp_timeout": 30,
          "force_symmetric_rtp": "false",
          "symmetric_rtp_ignore_rtcp": "false",
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "port": 5060,
          "transport_protocol_id": 2,
          "max_transfers": 0,
          "max_30x_redirects": 0,
          "media_encryption_mode": "disabled",
          "stir_shaken_mode": "disabled",
          "allowed_rtp_ips": null
        }
      }
    },
    "relationships": {
      "pop": {
        "data": {
          "type": "pops",
          "id": "240416e4-aeb2-4ca5-9df2-f37f01e930cf"
        }
      }
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_in_trunks -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --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", "codec_ids": [9, 7], "dns_srv_failover_timer": 2000, "force_symmetric_rtp": "false", "host": "example.com", "max_30x_redirects": 0, "max_transfers": 0, "media_encryption_mode": "disabled", "port": 5060, "rerouting_disconnect_code_ids": [58, 59], "resolve_ruri": "true", "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"}, "relationships": {"pop": {"data": {"id": "240416e4-aeb2-4ca5-9df2-f37f01e930cf", "type": "pops"}}}, "type": "voice_in_trunks"}}'
```

response

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "7adfab4e-83bc-45e2-84e6-60342a505713",
    "type": "voice_in_trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 18,
      "weight": 65535,
      "name": "Office SIP",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "port": 5060,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": true,
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": false,
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": true,
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": false,
          "rtp_timeout": 30,
          "force_symmetric_rtp": false,
          "symmetric_rtp_ignore_rtcp": false,
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1,
          "transport_protocol_id": 2,
          "max_transfers": 0,
          "max_30x_redirects": 0,
          "media_encryption_mode": "disabled",
          "stir_shaken_mode": "disabled",
          "allowed_rtp_ips": null
        }
      }
    },
    "relationships": {
      "voice_in_trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/389deacb-5be5-46d7-8cbd-aba11f66d6c2/relationships/voice_in_trunk_group",
          "related": "https://api.didww.com/v3/voice_in_trunks/389deacb-5be5-46d7-8cbd-aba11f66d6c2/voice_in_trunk_group"
        }
      },
      "pop": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunks/389deacb-5be5-46d7-8cbd-aba11f66d6c2/relationships/pop",
          "related": "https://api.didww.com/v3/voice_in_trunks/389deacb-5be5-46d7-8cbd-aba11f66d6c2/pop"
        },
        "data": {
          "type": "pops",
          "id": "240416e4-aeb2-4ca5-9df2-f37f01e930cf"
        }
      }
    }
  },
  "included": [
    {
      "id": "240416e4-aeb2-4ca5-9df2-f37f01e930cf",
      "type": "pops",
      "links": {
        "self": "https://api.didww.com/v3/pops/240416e4-aeb2-4ca5-9df2-f37f01e930cf"
      },
      "attributes": {
        "name": "USA, NY"
      }
    }
  ]
}
```

[[DIDWW-API-EXAMPLE-END]]

## Other Responses

| Code | Success | Description |
| --- | --- | --- |
| 422 | No | [Unprocessable Entity](../../../specification/errors/index.html#api-validation-error-object) |
| 401 | No | [Unauthorized](../../../configuration.html#api-key) |

On this page
