Update Outbound Trunk#

Updates an outbound trunk.

In version 2026-11-19, customers with the Outbound API enabled can update outbound trunks even if the Outbound feature is not enabled on the account. Without the Outbound API, the request returns 403 Forbidden.

Request#

HTTP Method: PATCH

URI Path: /v3/voice_out_trunks/{id}

URI Query Parameters#

Name

Type

Is Required?

Description

id

string

Yes

Unique identifier of the outbound trunk.

Data Attributes#

Name

Type

Nullable

Is Required?

Description

name

string

No

No

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. Null means no restriction. An empty list is rejected. 0.0.0.0/0 and ::/0 are rejected.

authentication_method

object

No

No

Authentication method object. Supported PATCH target types are credentials_and_ip and twilio. ip_only may be returned by GET endpoints but cannot be set through PATCH.

on_cli_mismatch_action

string

No

No

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. randomize_cli - replace the CLI with a random DID allowed on the trunk. An action the account does not have the feature for is rejected.

capacity_limit

integer

Yes

No

The capacity limit of the outbound trunk. Allowed values from 1 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.

threshold_amount

string

No

No

The outbound trunk 24-hour threshold limit. The accepted range depends on the account.

default_dst_action

string

No

No

Possible values: allow_all - allow calls to all destinations except the prefixes listed in dst_prefixes. reject_all - reject calls to all destinations except the prefixes listed in dst_prefixes.

dst_prefixes

Array of strings

No

No

The destination prefixes allowed or rejected based on default_dst_action. Each prefix is digits only, without a leading + or separators; any other value returns 422 Unprocessable Entity. Repeated prefixes are stored once.

emergency_enable_all

boolean

No

No

Allows all eligible DIDs to be used for emergency calling on the trunk.

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.

ice_mode

string

No

No

ICE (Interactive Connectivity Establishment) for calls from the trunk: not used, accepted when the trunk offers it, or initiated by DIDWW. Possible values: disabled, accept, initiate.

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.

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. With disabled, a call whose SDP offer uses a feedback profile (RTP/AVPF or UDP/TLS/RTP/SAVPF) is rejected with SIP 500 No suitable media. WebRTC clients always offer such a profile, so use accept or initiate for them.

codecs

Array of strings

No

No

Codecs offered on calls from 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, gsm, g722, opus, amr, amr_wb.

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

No

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

default_did

DID Object

The DID used as the caller ID. Required while on_cli_mismatch_action is replace_cli, and rejected otherwise. Only accepted on accounts with the replace_cli feature. Send data: null to clear it.

dids

DIDs

The DID numbers explicitly allowed as CLI when allow_any_did_as_cli is false. A DID that is awaiting registration (awaiting_registration is true) cannot be used as an allowed CLI: the request returns 422 Unprocessable Entity with one error per such DID.

emergency_dids

DIDs

The DID numbers explicitly enabled for emergency calling when emergency_enable_all is false.

Authentication Method#

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 - may be returned by GET endpoints, but PATCH does not allow changing authentication_method.type to ip_only.

Note

After changing the authentication type, the previous authentication attributes are cleared.

Authentication Method Attributes by Type#

Name

Type

Nullable

Is Required?

Description

allowed_sip_ips

Array of strings

No

Yes

The allowed originating SIP IPs.

tech_prefix

string

Yes

No

Prefix stripped from the dialled number before routing. The maximum length is 8 characters and only digits and # are supported.

Examples#

http

 1PATCH /v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f 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    "id": "cf2e6377-fcaa-4416-8c8e-acd5f31a427f",
10    "type": "voice_out_trunks",
11    "attributes": {
12      "authentication_method": {
13        "type": "twilio",
14        "attributes": {
15          "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
16        }
17      },
18      "allowed_rtp_ips": null,
19      "codecs": [
20        "pcma",
21        "pcmu",
22        "g729",
23        "g723",
24        "gsm",
25        "telephone_event"
26      ]
27    }
28  }
29}

curl

1curl -i -X PATCH https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"allowed_rtp_ips": null, "authentication_method": {"attributes": {"twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"}, "type": "twilio"}, "codecs": ["pcma", "pcmu", "g729", "g723", "gsm", "telephone_event"]}, "id": "cf2e6377-fcaa-4416-8c8e-acd5f31a427f", "type": "voice_out_trunks"}}'

response

 1HTTP/1.1 200 OK
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "cf2e6377-fcaa-4416-8c8e-acd5f31a427f",
 7    "type": "voice_out_trunks",
 8    "attributes": {
 9      "name": "Outbound trunk Name",
10      "allowed_rtp_ips": null,
11      "authentication_method": {
12        "type": "twilio",
13        "attributes": {
14          "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
15        }
16      },
17      "on_cli_mismatch_action": "send_original_cli",
18      "capacity_limit": 300,
19      "allow_any_did_as_cli": false,
20      "status": "blocked",
21      "threshold_reached": false,
22      "threshold_amount": "1000.0",
23      "default_dst_action": "allow_all",
24      "dst_prefixes": ["23", "45"],
25      "emergency_enable_all": false,
26      "media_encryption_mode": "disabled",
27      "ice_mode": "accept",
28      "rtcp_mux_mode": "accept",
29      "rtcp_feedback_mode": "accept",
30      "codecs": [
31        "pcma",
32        "pcmu",
33        "g729",
34        "g723",
35        "gsm",
36        "telephone_event"
37      ],
38      "force_symmetric_rtp": true,
39      "rtp_ping": true,
40      "rtp_timeout": 30,
41      "callback_url": null,
42      "created_at": "2025-04-02T10:00:00.000Z",
43      "external_reference_id": null
44    },
45    "relationships": {
46      "dids": {
47        "links": {
48          "self": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/relationships/dids",
49          "related": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/dids"
50        }
51      },
52      "emergency_dids": {
53        "links": {
54          "self": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/relationships/emergency_dids",
55          "related": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/emergency_dids"
56        }
57      }
58    },
59    "meta": {
60      "spent_amount": "12.34"
61    }
62  },
63  "meta": {
64    "api_version": "2026-11-19"
65  }
66}

Other Responses#

Code

Success

Description

404

No

Not Found

422

No

Validation Error Object

400

No

Bad Request

401

No

Unauthorized

403

No

The Outbound API is not enabled for the account. Also returned when the access token carries the read scope, which does not cover this method (title Insufficient scope, WWW-Authenticate: Bearer error="insufficient_scope"). See Scopes.

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.