Skip to main content
POST

Next steps

After creating your trunk, add a phone number to it.

Authorizations

Authorization
string
header
required

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

Body

application/json

SIP trunk configuration

name
string
required

Human-readable label. Must be unique per account.

Example:

"Zadarma Production"

provider
string
required

SIP provider name (e.g. twilio, plivo, zadarma, telnyx, vonage, custom)

Example:

"zadarma"

auth_type
enum<string>
required

Authentication method

Available options:
userpass,
ip-based
Example:

"userpass"

gateways
object[]
required

At least one gateway is required

description
string

Optional description for internal reference

auth_username
string

SIP username. Required when auth_type is userpass.

auth_password
string

SIP password. Required when auth_type is userpass.

ip_identifiers
object[]

Required when auth_type is ip-based

allow
string
default:ulaw,alaw

Comma-separated codecs to allow

disallow
string
default:all

Comma-separated codecs to disallow

transport
enum<string>
default:transport-udp

SIP transport protocol.

Available options:
transport-udp,
transport-tcp,
transport-tls
direct_media
boolean
default:false

RTP directly between caller and callee. Keep false.

rtp_symmetric
boolean
default:true

Symmetric RTP. Required for NAT.

force_rport
boolean
default:true

Force responses to source port. Required for NAT.

media_encryption
enum<string>
default:no

RTP encryption. Use "sdes" for SRTP. Requires transport=transport-tls.

Available options:
no,
sdes
media_encryption_optimistic
boolean
default:false

When media_encryption=sdes, fall back to clear RTP if the carrier does not offer crypto in its SDP.

qualify_frequency
integer
default:60

SIP OPTIONS ping interval in seconds. 0 to disable.

inbound_enabled
boolean
default:false

Set true to receive inbound calls on this trunk

outbound_leading_plus_enabled
boolean
default:true

Prepend + to outbound dialed numbers

phone_numbers
object[]

Optional phone numbers to add at creation time

Response

SIP trunk created successfully

SIP trunk object returned by the API.

id
string

Unique SIP trunk identifier.

name
string

Human-readable trunk name.

provider
string

SIP provider name (e.g., twilio, plivo, zadarma, telnyx, vonage, custom).

description
string

Optional trunk description for internal reference.

auth_type
enum<string>

Authentication method used for this trunk.

Available options:
userpass,
ip-based
auth_username
string

SIP username (present only for userpass trunks).

gateways
object[]

Ordered list of SIP gateways used for registration and call routing.

ip_identifiers
object[]

IP ranges associated with this trunk (used only for ip-based authentication).

phone_numbers
object[]

Phone numbers (DIDs) registered on this trunk.

allow
string

Comma-separated codecs to allow.

disallow
string

Comma-separated codecs to disallow.

transport
enum<string>

SIP transport used by the trunk.

Available options:
transport-udp,
transport-tcp,
transport-tls
direct_media
boolean

Whether RTP is routed directly between endpoints (typically false).

rtp_symmetric
boolean

Enables symmetric RTP to handle NAT.

force_rport
boolean

Forces responses to the source port to handle NAT.

media_encryption
enum<string>

RTP encryption mode. "no" for plain RTP, "sdes" for SRTP via SDES (TLS trunks only).

Available options:
no,
sdes
media_encryption_optimistic
boolean

When media_encryption=sdes, whether to fall back to clear RTP if the carrier does not offer crypto.

qualify_frequency
integer

SIP OPTIONS ping interval in seconds.

inbound_enabled
boolean

Whether inbound calling is enabled.

outbound_leading_plus_enabled
boolean

Whether to prepend a leading + to outbound dialed numbers.

is_active
boolean

Whether the trunk is active.

created_at
string<date-time>

ISO timestamp when the trunk was created.

updated_at
string<date-time>

ISO timestamp when the trunk was last updated.