Skip to main content
PATCH
To change a gateway or a carrier IP, remove it and add the new one. To change which agent answers a number, use Assign agent to number.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

trunk_id
string<uuid>
required

The trunk's id

Body

application/json

Send only the fields to change. Gateways, carrier IPs and numbers are managed through their own endpoints.

name
string
Required string length: 1 - 100
description
string | null
Maximum string length: 500
preset
enum<string> | null
Available options:
plivo,
telnyx,
twilio,
exotel,
vobiz,
vonage,
custom
is_active
boolean

false stops all inbound and outbound calls on the trunk.

inbound_enabled
boolean
outbound_enabled
boolean
channels
integer
Required range: 1 <= x <= 1000
default_inbound_agent_id
string | null

Agent for the trunk's numbers that have no agent of their own. null clears it.

auth_username
string | null

Send with auth_password. null on both clears the credentials.

Minimum string length: 1
auth_password
string<password> | null

Send with auth_username. null on both clears the credentials.

Minimum string length: 1
transport
enum<string>
Available options:
udp,
tcp
outbound_leading_plus_enabled
boolean
codecs
string

Any non-empty subset of PCMU and PCMA, comma-separated, in order of preference.

Example:

"PCMA,PCMU"

Response

The updated trunk

A SIP trunk with its gateways, carrier IPs, numbers and live status.

id
string<uuid>

Unique trunk ID.

Example:

"3f2b8c1e-6d4a-4f7b-9e2c-1a5d7b9c0e21"

name
string

Display name.

Example:

"Telnyx production"

description
string | null

Free-text note for your own reference.

preset
enum<string> | null

The carrier the trunk was set up for.

Available options:
plivo,
telnyx,
twilio,
exotel,
vobiz,
vonage,
custom
Example:

"telnyx"

is_active
boolean

When false, the trunk takes no inbound calls and places no outbound calls.

inbound_enabled
boolean

Whether the trunk accepts inbound calls from its carrier IPs.

outbound_enabled
boolean

Whether outbound calls can be placed from the trunk's numbers.

channels
integer

Maximum concurrent calls on the trunk, inbound and outbound combined.

Example:

20

default_inbound_agent_id
string | null

Agent that answers inbound calls to any of the trunk's numbers that has no agent_id of its own.

auth_username
string | null

Username your carrier issued, sent when the carrier challenges an outbound call (SIP 401/407). The password is never returned.

Example:

"bolna-outbound"

transport
enum<string>

SIP transport used towards your carrier's gateways.

Available options:
udp,
tcp
codecs
string

Codecs offered to the carrier, comma-separated, in order of preference.

Example:

"PCMU,PCMA"

outbound_leading_plus_enabled
boolean

When true, the dialled number is sent to the carrier with a leading + (+12025550178); when false, as digits only (12025550178).

last_inbound_at
string<date-time> | null

When the trunk last took an inbound call, updated at most once a minute. null until the first one.

last_outbound_at
string<date-time> | null

When an outbound call was last placed through the trunk, updated at most once a minute. null until the first one.

converted_from_byot_trunk_id
string | null

The legacy SIP trunk this trunk was migrated from, when Bolna migrated it for you. null otherwise.

organization_id
string | null

The organisation that owns the trunk. null for an account outside an organisation.

sub_account_id
string | null

The sub-account the trunk was created under. null for an organisation-level trunk.

user_id
string | null

The owning user, for an account outside an organisation. null for an organisation's trunk.

created_at
string<date-time>

When the trunk was created.

updated_at
string<date-time>

When the trunk's settings last changed.

is_deleted
boolean

true only in the response to a delete.

deleted_at
string<date-time> | null

When the trunk was deleted.

health
enum<string>
  • ready: calls have crossed the trunk and the carrier is not failing them.
  • waiting_for_carrier: no call has crossed the trunk yet.
  • degraded: the carrier failed three or more recent outbound calls with no answered call since.
  • disabled: is_active is false.
Available options:
ready,
waiting_for_carrier,
degraded,
disabled
active_calls
integer

Calls holding one of the trunk's channels right now.

Example:

0

gateways
object[]

Carrier SIP hosts outbound calls are sent to.

ip_acls
object[]

Carrier IPs inbound calls are accepted from.

numbers
object[]

The trunk's phone numbers, oldest first.