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 |
|
No |
Yes |
Must be |
attributes |
|
No |
Yes |
Outbound trunk attributes object. |
Data Attributes#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
name |
|
No |
Yes |
The outbound trunk name. |
external_reference_id |
|
Yes |
No |
Optional identifier for the outbound trunk in the customer’s external system. Maximum length is 100 characters. |
allowed_rtp_ips |
Array of |
Yes |
No |
Allowed RTP IP addresses for media traffic. Required when |
authentication_method |
|
No |
Yes |
Authentication method object. Supported POST types: |
on_cli_mismatch_action |
|
No |
Yes |
Possible values: |
capacity_limit |
|
Yes |
No |
The capacity limit of the outbound trunk. Allowed values from 0 to 32767. |
allow_any_did_as_cli |
|
No |
No |
When set to |
status |
|
No |
No |
Possible values: |
threshold_amount |
|
Yes |
No |
The outbound trunk 24-hour threshold limit. Can be from 50 to 100000. |
default_dst_action |
|
No |
No |
Possible values: |
dst_prefixes |
Array of |
Yes |
No |
The destination prefixes allowed or rejected based on |
emergency_enable_all |
|
No |
No |
Allows all eligible DIDs to be used for emergency calling on the trunk. Default value is |
media_encryption_mode |
|
No |
No |
Media encryption mode. Possible values: |
callback_url |
|
Yes |
No |
Can be |
force_symmetric_rtp |
|
No |
No |
Enables symmetric RTP / COMEDIA mode. |
rtp_ping |
|
No |
No |
Enables RTP ping after the call is connected. |
rtp_timeout |
|
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 for
information about callback_url and the JSON callback payload.
Request Body Object Relationships#
Title |
Type |
Description |
|---|---|---|
dids |
The DID numbers explicitly allowed as CLI when |
|
emergency_dids |
The DID numbers explicitly enabled for emergency calling when |
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_onlyis returned byGETendpoints but is not supported inPOSTrequests.
Authentication Method Attributes by Type#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
allowed_sip_ips |
Array of |
No |
Yes |
The allowed originating SIP IPs. |
tech_prefix |
|
Yes |
No |
An optional technical prefix added before the destination number. The maximum length is 8 characters and only digits and |
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
twilio_account_sid |
|
No |
Yes |
The Twilio Account SID. It is a 34-character identifier of the Twilio account. |
Examples#
http
1POST /v3/voice_out_trunks HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "voice_out_trunks",
10 "attributes": {
11 "name": "Outbound trunk Name",
12 "callback_url": null,
13 "allowed_rtp_ips": [
14 "0.0.0.0/0"
15 ],
16 "authentication_method": {
17 "type": "credentials_and_ip",
18 "attributes": {
19 "allowed_sip_ips": [
20 "0.0.0.0/0"
21 ],
22 "tech_prefix": null
23 }
24 },
25 "on_cli_mismatch_action": "send_original_cli",
26 "capacity_limit": 100,
27 "allow_any_did_as_cli": true,
28 "status": "active",
29 "threshold_amount": "10000.0",
30 "default_dst_action": "allow_all",
31 "dst_prefixes": [],
32 "emergency_enable_all": false,
33 "media_encryption_mode": "disabled",
34 "force_symmetric_rtp": false,
35 "rtp_ping": false,
36 "rtp_timeout": 30
37 }
38 }
39}
curl
1curl -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
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "03813615-da15-4e3b-8e0a-3ea64b2585de",
7 "type": "voice_out_trunks",
8 "attributes": {
9 "name": "Outbound trunk Name",
10 "callback_url": null,
11 "allowed_rtp_ips": [
12 "0.0.0.0/0"
13 ],
14 "authentication_method": {
15 "type": "credentials_and_ip",
16 "attributes": {
17 "allowed_sip_ips": [
18 "0.0.0.0/0"
19 ],
20 "tech_prefix": null,
21 "username": "554******",
22 "password": "fqe******"
23 }
24 },
25 "on_cli_mismatch_action": "send_original_cli",
26 "capacity_limit": 100,
27 "allow_any_did_as_cli": true,
28 "status": "active",
29 "threshold_reached": false,
30 "threshold_amount": "10000.0",
31 "default_dst_action": "allow_all",
32 "dst_prefixes": [],
33 "emergency_enable_all": false,
34 "media_encryption_mode": "disabled",
35 "force_symmetric_rtp": false,
36 "rtp_ping": false,
37 "rtp_timeout": 30,
38 "created_at": "2025-04-02T10:00:00.000Z",
39 "external_reference_id": null
40 },
41 "relationships": {
42 "dids": {
43 "links": {
44 "self": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/relationships/dids",
45 "related": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/dids"
46 }
47 },
48 "emergency_dids": {
49 "links": {
50 "self": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/relationships/emergency_dids",
51 "related": "https://api.didww.com/v3/voice_out_trunks/03813615-da15-4e3b-8e0a-3ea64b2585de/emergency_dids"
52 }
53 }
54 }
55 },
56 "meta": {
57 "api_version": "2026-04-16"
58 }
59}
http
1POST /v3/voice_out_trunks HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "voice_out_trunks",
10 "attributes": {
11 "name": "Outbound trunk Name",
12 "callback_url": null,
13 "allowed_rtp_ips": null,
14 "authentication_method": {
15 "type": "twilio",
16 "attributes": {
17 "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
18 }
19 },
20 "on_cli_mismatch_action": "send_original_cli",
21 "capacity_limit": 100,
22 "allow_any_did_as_cli": true,
23 "status": "active",
24 "threshold_amount": "10000.0",
25 "default_dst_action": "allow_all",
26 "dst_prefixes": [],
27 "emergency_enable_all": false,
28 "media_encryption_mode": "disabled",
29 "force_symmetric_rtp": false,
30 "rtp_ping": false,
31 "rtp_timeout": 30
32 }
33 }
34}
curl
1curl -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
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "14a0b7fb-845a-44d9-a7dc-ac1620f21e42",
7 "type": "voice_out_trunks",
8 "attributes": {
9 "name": "Outbound trunk Name",
10 "callback_url": null,
11 "allowed_rtp_ips": null,
12 "authentication_method": {
13 "type": "twilio",
14 "attributes": {
15 "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
16 }
17 },
18 "on_cli_mismatch_action": "send_original_cli",
19 "capacity_limit": 100,
20 "allow_any_did_as_cli": true,
21 "status": "active",
22 "threshold_reached": false,
23 "threshold_amount": "10000.0",
24 "default_dst_action": "allow_all",
25 "dst_prefixes": [],
26 "emergency_enable_all": false,
27 "media_encryption_mode": "disabled",
28 "force_symmetric_rtp": false,
29 "rtp_ping": false,
30 "rtp_timeout": 30,
31 "created_at": "2025-04-02T10:00:00.000Z",
32 "external_reference_id": null
33 },
34 "relationships": {
35 "dids": {
36 "links": {
37 "self": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/relationships/dids",
38 "related": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/dids"
39 }
40 },
41 "emergency_dids": {
42 "links": {
43 "self": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/relationships/emergency_dids",
44 "related": "https://api.didww.com/v3/voice_out_trunks/14a0b7fb-845a-44d9-a7dc-ac1620f21e42/emergency_dids"
45 }
46 }
47 }
48 },
49 "meta": {
50 "api_version": "2026-04-16"
51 }
52}
http
1POST /v3/voice_out_trunks HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "voice_out_trunks",
10 "attributes": {
11 "name": "Outbound trunk for selected emergency DIDs",
12 "authentication_method": {
13 "type": "credentials_and_ip",
14 "attributes": {
15 "allowed_sip_ips": [
16 "0.0.0.0/0"
17 ]
18 }
19 },
20 "on_cli_mismatch_action": "send_original_cli",
21 "emergency_enable_all": false
22 },
23 "relationships": {
24 "emergency_dids": {
25 "data": [
26 {
27 "id": "7158ac26-392f-47d1-89ab-c8b3f5ec05d9",
28 "type": "dids"
29 },
30 {
31 "id": "67a90c09-1bff-4bc3-a35e-116fda2b0d22",
32 "type": "dids"
33 }
34 ]
35 }
36 }
37 }
38}
curl
1curl -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
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "9c91f03e-8796-4e6a-8c12-00e4f334f9b2",
7 "type": "voice_out_trunks",
8 "attributes": {
9 "name": "Outbound trunk for selected emergency DIDs",
10 "callback_url": null,
11 "allowed_rtp_ips": null,
12 "authentication_method": {
13 "type": "credentials_and_ip",
14 "attributes": {
15 "allowed_sip_ips": [
16 "0.0.0.0/0"
17 ],
18 "tech_prefix": null,
19 "username": "554******",
20 "password": "fqe******"
21 }
22 },
23 "on_cli_mismatch_action": "send_original_cli",
24 "capacity_limit": null,
25 "allow_any_did_as_cli": false,
26 "status": "active",
27 "threshold_reached": false,
28 "threshold_amount": null,
29 "default_dst_action": "allow_calls",
30 "dst_prefixes": null,
31 "emergency_enable_all": false,
32 "media_encryption_mode": "disable",
33 "force_symmetric_rtp": false,
34 "rtp_ping": false,
35 "rtp_timeout": 30,
36 "created_at": "2025-04-02T10:00:00.000Z",
37 "external_reference_id": null
38 },
39 "relationships": {
40 "dids": {
41 "links": {
42 "self": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/relationships/dids",
43 "related": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/dids"
44 },
45 "data": []
46 },
47 "emergency_dids": {
48 "links": {
49 "self": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/relationships/emergency_dids",
50 "related": "https://api.didww.com/v3/voice_out_trunks/9c91f03e-8796-4e6a-8c12-00e4f334f9b2/emergency_dids"
51 }
52 },
53 "data": [
54 {
55 "id": "7158ac26-392f-47d1-89ab-c8b3f5ec05d9",
56 "type": "dids"
57 },
58 {
59 "id": "67a90c09-1bff-4bc3-a35e-116fda2b0d22",
60 "type": "dids"
61 }
62 ]
63 }
64 }
65 },
66 "meta": {
67 "api_version": "2026-04-16"
68 }
69}
Other Responses#
Code |
Success |
Description |
|---|---|---|
422 |
No |
|
400 |
No |
|
401 |
No |