Create SIP trunk API
Create a SIP trunk to your own carrier via POST /trunk/trunks, with gateways for outbound calls and carrier IPs for inbound calls.
200, not 201. Send the carrier’s credentials only if it challenges Bolna’s outbound calls; a carrier that authenticates Bolna by IP needs Bolna’s signalling IPs from GET /trunk/pop on its allowlist instead.Next steps
- Add your carrier’s numbers to the trunk.
- Point your carrier at the values from
GET /trunk/pop.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Display name.
1 - 100"Telnyx production"
Free-text note for your own reference.
500The carrier the trunk is for. Stored as a label; the API does not fill any other field from it.
plivo, telnyx, twilio, exotel, vobiz, vonage, custom Accept inbound calls from the trunk's carrier IPs.
Allow outbound calls from the trunk's numbers.
Maximum concurrent calls on the trunk, inbound and outbound combined. An inbound call over the limit is refused with SIP 486 Busy Here; an outbound call over it waits in your call queue until a channel is free.
1 <= x <= 1000Agent that answers inbound calls to any of the trunk's numbers that has no agent_id of its own. Must be one of your agents.
Username your carrier issued for Bolna's outbound calls, sent when the carrier challenges the INVITE (SIP 401/407). Set together with auth_password, or leave both out when the carrier authenticates Bolna by IP. Must not contain a quote, |, {, }, \ or a control character.
1Password for auth_username. Stored encrypted; never returned. The same character rules apply.
1SIP transport towards your carrier's gateways. tls is rejected.
udp, tcp Send the dialled number to the carrier with a leading +. When false, the number is sent as digits only.
Comma-separated codecs offered to the carrier, in order of preference. Any non-empty subset of PCMU and PCMA; values are upper-cased.
Carrier SIP hosts that outbound calls are sent to. Leave empty for an inbound-only trunk.
8Addresses or CIDR ranges your carrier sends inbound calls from. Public IPv4, no broader than /16. A bare address is stored as a /32.
32Response
The created trunk. Bare IP addresses in ip_acls come back as /32 networks.
A SIP trunk with its gateways, carrier IPs, numbers and live status.
Unique trunk ID.
"3f2b8c1e-6d4a-4f7b-9e2c-1a5d7b9c0e21"
Display name.
"Telnyx production"
Free-text note for your own reference.
The carrier the trunk was set up for.
plivo, telnyx, twilio, exotel, vobiz, vonage, custom "telnyx"
When false, the trunk takes no inbound calls and places no outbound calls.
Whether the trunk accepts inbound calls from its carrier IPs.
Whether outbound calls can be placed from the trunk's numbers.
Maximum concurrent calls on the trunk, inbound and outbound combined.
20
Agent that answers inbound calls to any of the trunk's numbers that has no agent_id of its own.
Username your carrier issued, sent when the carrier challenges an outbound call (SIP 401/407). The password is never returned.
"bolna-outbound"
SIP transport used towards your carrier's gateways.
udp, tcp Codecs offered to the carrier, comma-separated, in order of preference.
"PCMU,PCMA"
When true, the dialled number is sent to the carrier with a leading + (+12025550178); when false, as digits only (12025550178).
When the trunk last took an inbound call, updated at most once a minute. null until the first one.
When an outbound call was last placed through the trunk, updated at most once a minute. null until the first one.
The legacy SIP trunk this trunk was migrated from, when Bolna migrated it for you. null otherwise.
The organisation that owns the trunk. null for an account outside an organisation.
The sub-account the trunk was created under. null for an organisation-level trunk.
The owning user, for an account outside an organisation. null for an organisation's trunk.
When the trunk was created.
When the trunk's settings last changed.
true only in the response to a delete.
When the trunk was deleted.
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_activeisfalse.
ready, waiting_for_carrier, degraded, disabled Calls holding one of the trunk's channels right now.
0
Carrier SIP hosts outbound calls are sent to.
Carrier IPs inbound calls are accepted from.
The trunk's phone numbers, oldest first.

