# Create Outbound Trunk

Creates an outbound trunk.

In version `2026-04-16`, customers can create outbound trunks through the API even if the Outbound feature is not
enabled on the account.

## Request

HTTP Method: `POST`

URI Path: `/v3/voice_out_trunks`

### Body Parameters

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| type | `string` | No | Yes | Must be `voice_out_trunks`. |
| attributes | `object` | No | Yes | Outbound trunk attributes object. |

### Data Attributes

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| name | `string` | No | Yes | The outbound trunk name. |
| external\_reference\_id | `string` | Yes | No | Optional identifier for the outbound trunk in the customer's external system. Maximum length is 100 characters. |
| allowed\_rtp\_ips | Array of `strings` | Yes | No | Allowed RTP IP addresses for media traffic. Required when `authentication_method.type` is `credentials_and_ip`. |
| authentication\_method | `object` | No | Yes | Authentication method object. Supported POST types:   `credentials_and_ip` - use SIP credentials together with allowed IP addresses.   `twilio` - use a Twilio Account SID for authentication.   `ip_only` is not supported in `POST` requests. |
| on\_cli\_mismatch\_action | `string` | No | Yes | Possible values:   `send_original_cli` - pass the original `From` header value from your system to the destination without modification.   `reject_call` - reject the call if the `From` header value does not match any DID allowed on the trunk.   `replace_cli` - replace the CLI with one of the DIDs allowed on the trunk. |
| capacity\_limit | `integer` | Yes | No | The capacity limit of the outbound trunk. Allowed values from 0 to 32767. |
| allow\_any\_did\_as\_cli | `boolean` | No | No | When set to `true`, all eligible DIDs can be used as CLI and the `dids` relationship must not contain explicit DIDs. |
| status | `string` | No | No | Possible values:   `active` - the trunk can be used for outbound traffic.   `blocked` - outbound traffic on the trunk is blocked.   If set to `null`, the default value is `active`. |
| threshold\_amount | `string` | Yes | No | The outbound trunk 24-hour threshold limit. Can be from 50 to 100000. |
| default\_dst\_action | `string` | No | No | Possible values:   `allow_all` - allow calls to all destinations except the prefixes listed in `dst_prefixes`.   `reject_all` - s to all destinations except the prefixes listed in `dst_prefixes`. |
| dst\_prefixes | Array of `strings` | Yes | No | The destination prefixes allowed or rejected based on `default_dst_action`. |
| emergency\_enable\_all | `boolean` | No | No | Allows all eligible DIDs to be used for emergency calling on the trunk. Default value is `false`. |
| media\_encryption\_mode | `string` | No | No | Media encryption mode. Possible values:   `disabled` - media encryption is turned off.   `srtp_sdes` - use SRTP encryption with SDES key exchange.   `srtp_dtls` - use SRTP encryption with DTLS key exchange.   `zrtp` - use SRTP encryption with ZRTP key exchange. |
| callback\_url | `string` | Yes | No | Can be `null` or a valid HTTP(S) URL. |
| force\_symmetric\_rtp | `boolean` | No | No | Enables symmetric RTP / COMEDIA mode. |
| rtp\_ping | `boolean` | No | No | Enables RTP ping after the call is connected. |
| rtp\_timeout | `integer` | Yes | No | Disconnects the call if RTP packets do not arrive within the specified time. Supported values are from 30 to 600 seconds. |

See [Outbound Trunk callback details](../../callbacks-details.html#callbacks-voice-out-trunk-v34) for
information about `callback_url` and the JSON callback payload.

### Request Body Object Relationships

| Title | Type | Description |
| --- | --- | --- |
| dids | [DIDs](../did/index.html#dids-v34) | The DID numbers explicitly allowed as CLI when `allow_any_did_as_cli` is `false`. DIDs must support `voice_out` feature to be selected. |
| emergency\_dids | [DIDs](../did/index.html#dids-v34) | The DID numbers explicitly enabled for emergency calling when `emergency_enable_all` is `false`. DIDs must support `voice_out` and `emergency` features and have `emergency_enabled = true` to be selected. |

### Authentication Method

The outbound trunk authentication is configured through the `authentication_method` attribute.

Supported authentication method types:

- `credentials_and_ip` - uses SIP credentials together with allowed IP addresses.
- `twilio` - uses a Twilio Account SID for authentication.
- `ip_only` is returned by `GET` endpoints but is not supported in `POST` requests.

#### Authentication Method Attributes by Type

credentials\_and\_iptwilio

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| allowed\_sip\_ips | Array of `strings` | No | Yes | The allowed originating SIP IPs. |
| tech\_prefix | `string` | Yes | No | An optional technical prefix added before the destination number. The maximum length is 8 characters and only digits and `#` are supported. |

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| twilio\_account\_sid | `string` | No | Yes | The Twilio Account SID. It is a 34-character identifier of the Twilio account. |

## Examples

credentials\_and\_iptwilioSelected emergency DIDs

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_out_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_out_trunks",
    "attributes": {
      "name": "Outbound trunk Name",
      "callback_url": null,
      "allowed_rtp_ips": [
        "0.0.0.0/0"
      ],
      "authentication_method": {
        "type": "credentials_and_ip",
        "attributes": {
          "allowed_sip_ips": [
            "0.0.0.0/0"
          ],
          "tech_prefix": null
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "capacity_limit": 100,
      "allow_any_did_as_cli": true,
      "status": "active",
      "threshold_amount": "10000.0",
      "default_dst_action": "allow_all",
      "dst_prefixes": [],
      "emergency_enable_all": false,
      "media_encryption_mode": "disabled",
      "force_symmetric_rtp": false,
      "rtp_ping": false,
      "rtp_timeout": 30
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_out_trunks -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_any_did_as_cli": true, "allowed_rtp_ips": ["0.0.0.0/0"], "authentication_method": {"attributes": {"allowed_sip_ips": ["0.0.0.0/0"], "tech_prefix": null}, "type": "credentials_and_ip"}, "callback_url": null, "capacity_limit": 100, "default_dst_action": "allow_all", "dst_prefixes": [], "emergency_enable_all": false, "force_symmetric_rtp": false, "media_encryption_mode": "disabled", "name": "Outbound trunk Name", "on_cli_mismatch_action": "send_original_cli", "rtp_ping": false, "rtp_timeout": 30, "status": "active", "threshold_amount": "10000.0"}, "type": "voice_out_trunks"}}'
```

response

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

{
  "data": {
    "id": "03813615-da15-4e3b-8e0a-3ea64b2585de",
    "type": "voice_out_trunks",
    "attributes": {
      "name": "Outbound trunk Name",
      "callback_url": null,
      "allowed_rtp_ips": [
        "0.0.0.0/0"
      ],
      "authentication_method": {
        "type": "credentials_and_ip",
        "attributes": {
          "allowed_sip_ips": [
            "0.0.0.0/0"
          ],
          "tech_prefix": null,
          "username": "554******",
          "password": "fqe******"
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "capacity_limit": 100,
      "allow_any_did_as_cli": true,
      "status": "active",
      "threshold_reached": false,
      "threshold_amount": "10000.0",
      "default_dst_action": "allow_all",
      "dst_prefixes": [],
      "emergency_enable_all": false,
      "media_encryption_mode": "disabled",
      "force_symmetric_rtp": false,
      "rtp_ping": false,
      "rtp_timeout": 30,
      "created_at": "2025-04-02T10:00:00.000Z",
      "external_reference_id": null
    },
    "relationships": {
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/relationships/dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/dids"
        }
      },
      "emergency_dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/relationships/emergency_dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/emergency_dids"
        }
      }
    }
  },
  "meta": {
    "api_version": "2026-04-16"
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_out_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_out_trunks",
    "attributes": {
      "name": "Outbound trunk Name",
      "callback_url": null,
      "allowed_rtp_ips": null,
      "authentication_method": {
        "type": "twilio",
        "attributes": {
          "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "capacity_limit": 100,
      "allow_any_did_as_cli": true,
      "status": "active",
      "threshold_amount": "10000.0",
      "default_dst_action": "allow_all",
      "dst_prefixes": [],
      "emergency_enable_all": false,
      "media_encryption_mode": "disabled",
      "force_symmetric_rtp": false,
      "rtp_ping": false,
      "rtp_timeout": 30
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_out_trunks -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_any_did_as_cli": true, "allowed_rtp_ips": null, "authentication_method": {"attributes": {"twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"}, "type": "twilio"}, "callback_url": null, "capacity_limit": 100, "default_dst_action": "allow_all", "dst_prefixes": [], "emergency_enable_all": false, "force_symmetric_rtp": false, "media_encryption_mode": "disabled", "name": "Outbound trunk Name", "on_cli_mismatch_action": "send_original_cli", "rtp_ping": false, "rtp_timeout": 30, "status": "active", "threshold_amount": "10000.0"}, "type": "voice_out_trunks"}}'
```

response

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

{
  "data": {
    "id": "14a0b7fb-845a-44d9-a7dc-ac1620f21e42",
    "type": "voice_out_trunks",
    "attributes": {
      "name": "Outbound trunk Name",
      "callback_url": null,
      "allowed_rtp_ips": null,
      "authentication_method": {
        "type": "twilio",
        "attributes": {
          "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "capacity_limit": 100,
      "allow_any_did_as_cli": true,
      "status": "active",
      "threshold_reached": false,
      "threshold_amount": "10000.0",
      "default_dst_action": "allow_all",
      "dst_prefixes": [],
      "emergency_enable_all": false,
      "media_encryption_mode": "disabled",
      "force_symmetric_rtp": false,
      "rtp_ping": false,
      "rtp_timeout": 30,
      "created_at": "2025-04-02T10:00:00.000Z",
      "external_reference_id": null
    },
    "relationships": {
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/relationships/dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/dids"
        }
      },
      "emergency_dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/relationships/emergency_dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/emergency_dids"
        }
      }
    }
  },
  "meta": {
    "api_version": "2026-04-16"
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_out_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_out_trunks",
    "attributes": {
      "name": "Outbound trunk for selected emergency DIDs",
      "authentication_method": {
        "type": "credentials_and_ip",
        "attributes": {
          "allowed_sip_ips": [
            "0.0.0.0/0"
          ]
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "emergency_enable_all": false
   },
   "relationships": {
      "emergency_dids": {
        "data": [
          {
            "id": "7158ac26-392f-47d1-89ab-c8b3f5ec05d9",
            "type": "dids"
          },
          {
            "id": "67a90c09-1bff-4bc3-a35e-116fda2b0d22",
            "type": "dids"
          }
        ]
      }
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_out_trunks -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"authentication_method": {"attributes": {"allowed_sip_ips": ["0.0.0.0/0"]}, "type": "credentials_and_ip"}, "emergency_enable_all": false, "name": "Outbound trunk for selected emergency DIDs", "on_cli_mismatch_action": "send_original_cli"}, "relationships": {"emergency_dids": {"data": [{"id": "7158ac26-392f-47d1-89ab-c8b3f5ec05d9", "type": "dids"}, {"id": "67a90c09-1bff-4bc3-a35e-116fda2b0d22", "type": "dids"}]}}, "type": "voice_out_trunks"}}'
```

response

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

{
  "data": {
    "id": "9c91f03e-8796-4e6a-8c12-00e4f334f9b2",
    "type": "voice_out_trunks",
    "attributes": {
      "name": "Outbound trunk for selected emergency DIDs",
      "callback_url": null,
      "allowed_rtp_ips": null,
      "authentication_method": {
        "type": "credentials_and_ip",
        "attributes": {
          "allowed_sip_ips": [
            "0.0.0.0/0"
          ],
          "tech_prefix": null,
          "username": "554******",
          "password": "fqe******"
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "capacity_limit": null,
      "allow_any_did_as_cli": false,
      "status": "active",
      "threshold_reached": false,
      "threshold_amount": null,
      "default_dst_action": "allow_calls",
      "dst_prefixes": null,
      "emergency_enable_all": false,
      "media_encryption_mode": "disable",
      "force_symmetric_rtp": false,
      "rtp_ping": false,
      "rtp_timeout": 30,
      "created_at": "2025-04-02T10:00:00.000Z",
      "external_reference_id": null
    },
    "relationships": {
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/relationships/dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/dids"
        },
        "data": []
      },
      "emergency_dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/relationships/emergency_dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/emergency_dids"
        }
        },
        "data": [
          {
            "id": "7158ac26-392f-47d1-89ab-c8b3f5ec05d9",
            "type": "dids"
          },
          {
            "id": "67a90c09-1bff-4bc3-a35e-116fda2b0d22",
            "type": "dids"
          }
        ]
      }
    }
  },
  "meta": {
    "api_version": "2026-04-16"
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

## Other Responses

| Code | Success | Description |
| --- | --- | --- |
| 422 | No | [Validation Error Object](../../../specification/errors/index.html#api-validation-error-object) |
| 400 | No | [Bad Request](../../../specification/errors/index.html#api-bad-request) |
| 401 | No | [Unauthorized](../../../configuration.html#api-key) |

On this page
