Create a SIP trunk
Creates a durable trunk row and starts asynchronous provider provisioning. Poll resource_url until status is active or error. Supply Idempotency-Key so a network retry cannot create a duplicate provider trunk.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255application/json- body
Creates either a customer-managed SIP trunk or an automated Twilio trunk. Credentials are write-only and never appear in responses.
Workflow rules:
- provider=twilio_automated requires account_sid and auth_token and forbids all BYO signaling, address, and auth fields; Kejue Voice derives those values.
- provider=sip defaults sip_signaling_mode to static_peer. static_peer requires inbound_auth_mode. ip_allowlist requires inbound_allowed_addresses; credentials requires auth_username and auth_password.
- registered_peer requires auth_username and auth_password and derives inbound auth/address configuration. If outbound_auth_mode is supplied it must be ip_allowlist.
- remote_registered_peer requires auth_username, auth_password, and remote_registrar_address; it derives inbound and outbound routing. Other remote registration values have documented defaults.
- A static outbound_address defaults outbound_transport to tls and outbound_auth_mode to credentials. Credential auth requires auth_username and auth_password; ip_allowlist forbids them unless registered_peer also needs them for registration.
- outbound_capacity_mode defaults to unknown. fixed requires max_concurrent_outbound or max_outbound_cps; burst requires max_outbound_cps. Limits are forbidden for unknown and unlimited modes.
name*stringUnique display name within the organization. Leading and trailing whitespace is removed.
2 <= length <= 80provider*SipTrunkProvidersip uses customer-managed carrier/PBX configuration; twilio_automated provisions Twilio resources from stored account credentials.
"sip""twilio_automated"sip_signaling_mode?SipSignalingMode"static_peer""registered_peer""remote_registered_peer"inbound_auth_mode?SipAuthMode"ip_allowlist""credentials"inbound_allowed_addresses?array<>IPv4/IPv6 addresses or CIDRs. Values are canonicalized and duplicates removed.
items <= 100outbound_address?stringSIP host or host:port without a username or URI scheme.
length <= 512outbound_transport?SipTransport"udp""tcp""tls"outbound_auth_mode?SipAuthMode"ip_allowlist""credentials"auth_username?stringWrite-only SIP digest username. Limited to 256 encoded UTF-8 bytes.
length <= 256auth_password?stringWrite-only SIP digest password. Limited to 1024 encoded UTF-8 bytes.
length <= 1024remote_registrar_address?stringRemote PBX/carrier SIP host or host:port. Required for remote_registered_peer.
length <= 512remote_registrar_transport?stringDefaults to udp.
"udp""tcp""tls"remote_registrar_domain?stringDigest domain; derived from remote_registrar_address when omitted.
1 <= lengthremote_register_realm?stringDigest realm; defaults to remote_registrar_domain.
1 <= lengthremote_register_expires_seconds?integer60 <= value <= 3600300account_sid?stringWrite-only Twilio account SID for provider=twilio_automated.
length <= 128auth_token?stringWrite-only Twilio auth token for provider=twilio_automated.
length <= 1024inbound_advanced_settings?Optional LiveKit inbound-leg settings. Omitted fields use provider defaults.
outbound_advanced_settings?Optional LiveKit outbound-leg settings plus Kejue Voice toll-fraud destination allowlists.
outbound_capacity_mode?SipOutboundCapacityMode"unknown""fixed""unlimited"max_concurrent_outbound?integer1 <= valuemax_outbound_cps?number0 < valueoutbound_cps_burst?integer1 <= valueoutbound_capacity_profile_id?stringCapacity profile in the same organization.
uuidThe trunk was created and provisioning was scheduled.
application/json- response
Stable polling contract returned after asynchronous create or reconcile acceptance.
id*stringuuidstatus*stringresource_url*string^/v1/sip-trunks/[0-9a-f-]+$poll_after_seconds*integer1 <= valueprovisioning_async*booleancurl -X POST 'https://api.kejue.co/v1/sip-trunks' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "provider": "sip"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "status": "provisioning", "resource_url": "string", "poll_after_seconds": 1, "provisioning_async": true}