Update Outbound Trunk

Updates an outbound trunk.

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

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. Required when changing authentication_method.type to credentials_and_ip.

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.

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.

threshold_amount

string

Yes

No

The outbound trunk 24-hour threshold limit. Can be from 0.0 to 100000.0.

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.

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.

Request Body Object Relationships

Title

Type

Description

dids

DIDs

The DID numbers explicitly allowed as CLI when allow_any_did_as_cli is false.

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

An optional technical prefix added before the destination number. The maximum length is 8 characters and only digits and # are supported.

Examples

http

PATCH /v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "cf2e6377-fcaa-4416-8c8e-acd5f31a427f",
    "type": "voice_out_trunks",
    "attributes": {
      "authentication_method": {
        "type": "twilio",
        "attributes": {
          "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
        }
      },
      "allowed_rtp_ips": null
    }
  }
}

curl

curl -i -X PATCH https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allowed_rtp_ips": null, "authentication_method": {"attributes": {"twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"}, "type": "twilio"}}, "id": "cf2e6377-fcaa-4416-8c8e-acd5f31a427f", "type": "voice_out_trunks"}}'

response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "cf2e6377-fcaa-4416-8c8e-acd5f31a427f",
    "type": "voice_out_trunks",
    "attributes": {
      "name": "Outbound trunk Name",
      "allowed_rtp_ips": null,
      "authentication_method": {
        "type": "twilio",
        "attributes": {
          "twilio_account_sid": "AC39347AF064AF97E1682C3B7332DAAEE6"
        }
      },
      "on_cli_mismatch_action": "send_original_cli",
      "capacity_limit": 300,
      "allow_any_did_as_cli": false,
      "status": "blocked",
      "threshold_reached": false,
      "threshold_amount": "1000.0",
      "default_dst_action": "allow_all",
      "dst_prefixes": ["23", "45"],
      "emergency_enable_all": false,
      "media_encryption_mode": "disabled",
      "force_symmetric_rtp": true,
      "rtp_ping": true,
      "rtp_timeout": 30,
      "callback_url": null,
      "created_at": "2025-04-02T10:00:00.000Z",
      "external_reference_id": null
    },
    "relationships": {
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/relationships/dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/dids"
        }
      },
      "emergency_dids": {
        "links": {
          "self": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/relationships/emergency_dids",
          "related": "https://api.didww.com/v3/voice_out_trunks/cf2e6377-fcaa-4416-8c8e-acd5f31a427f/emergency_dids"
        }
      }
    }
  },
  "meta": {
    "api_version": "2026-04-16"
  }
}

Other Responses

Code

Success

Description

404

No

Not Found

422

No

Validation Error Object

400

No

Bad Request

401

No

Unauthorized